- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的 HTML 和 JS:
<div id="datepicker" class="input-group date" data-date-format="mm-dd-yyyy">
<label runat="server" for="DOB"></label>
<input class="form-control" type="text" id="DOB" name="DOB" />
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i>
</span>
</div>
$("#datepicker").datepicker({
autoclose: true,
todayHighlight: true,
}).datepicker('update', new Date()).datepicker("setDate", null);
它早些时候工作得很好,但我在这个日期选择器代码之前添加了一些其他的 jQuery 代码,它停止工作了。
最佳答案
$(document).ready(function () {
$('#registertn').validate({
rules: {
firstname: "required",
lastname: "required",
instemail: {
required: true,
email: true
},
rollno: {
required: true,
number: true
},
program: {
required: true
},
specializn: {
required: true
},
ffirstname: "required",
flastname: "required",
mfirstname: "required",
mlastname: "required",
Gender: {
required: true
},
DOB: "required",
category: {
required: true
},
religion: {
required: true
},
address: "required",
area: "required",
state: "required",
country: "required",
pin: {
required: true,
number: true,
maxlength: 6,
minlength: 6
},
fmob: {
required: true,
number: true,
maxlength: 10,
minlength: 10
},
mob: {
required: true,
number: true,
maxlength: 10,
minlength: 10
},
peid: {
required: true,
email: true
}
},
errorPlacement: function (error, element) {
if (element.is(":radio")) {
error.insertAfter('#radio');
}
else {
error.insertAfter(element);
}
},
messages: {
firstname: "First Name field cannot be blank!",
lastname: "Last Name field cannot be blank!",
ffirstname: "First Name field cannot be blank!",
flastname: "Last Name field cannot be blank!",
mfirstname: "First Name field cannot be blank!",
mlastname: "Last Name field cannot be blank!",
rollno: {
required: "Roll Number/ID field cannot be blank!",
number: "Please enter a valid Roll Number!"
},
instemail:
{
required: "Institute Email field cannot be empty!",
email: "Please enter a valid email address!"
},
program: "Please select a Program!",
specializn: "Please select a Specialization!",
Gender: "Please select your Gender!",
DOB: "Please enter your Date of Birth!",
category: "Please select a Category!",
religion: "Please select a Religion!",
address: "Address field cannot be blank!",
area: "Home City field cannot be blank!",
state: "Home State field cannot be blank!",
country: "Home Country field cannot be blank!",
pin: {
required: "Home Pin Code field cannot be blank!",
number: "Please enter a valid Pin Code!",
maxlength: "Maximum number count should not exceed 6!",
minlength: "Minimum number count should be 6!"
},
fmob: {
required: "Please provide your Father's mobile number!",
number: "Mobile number should only consists of numbers!",
maxlength: "Maximum number count should not exceed 10!",
minlength: "Minimum number count should be 10!"
},
mob: {
required: "Mobile field cannot be blank!",
number: "Mobile number should only consists of numbers!",
maxlength: "Maximum number count should not exceed 10!",
minlength: "Minimum number count should be 10!"
},
peid: {
required: "Personal Email field cannot be empty!",
email: "Please enter a valid email address!"
}
},
submitHandler: function(form) {
//$('#submit').click(function () {
var jsondata = {};
jsondata.RollNo = $('#rollno').val();
jsondata.InstituteEmail = $('#instemail').val();
jsondata.Program = $('#program').val();
jsondata.Specialization = $('#specializn').val();
jsondata.StudentFName = $('#firstname').val();
jsondata.StudentMName = $('#midname').val();
jsondata.StudentLName = $('#lastname').val();
jsondata.FatherFName = $('#ffirstname').val();
jsondata.FatherMName = $('#fmidname').val();
jsondata.FatherLName = $('#flastname').val();
jsondata.MotherFName = $('#mfirstname').val();
jsondata.MotherMName = $('#mmidname').val();
jsondata.MotherLName = $('#mlastname').val();
jsondata.Gender = $("input[type='radio'][name='Gender']:checked").val();
jsondata.DOB = $('#DOB').val();
jsondata.Category = $('#category').val();
jsondata.Religion = $('#religion').val();
jsondata.PhysicalyHandicap = $('#ph').val();
jsondata.ColorBlindness = $('#cb').val();
jsondata.BloodGroup = $('#bg').val();
jsondata.ArmedForce = $('#af').val();
jsondata.Address = $('#address').val();
jsondata.HomeCity = $('#area').val();
jsondata.HomeState = $('#state').val();
jsondata.HomePin = $('#pin').val();
jsondata.HomeCountry = $('#country').val();
jsondata.FatherMobile = $('#fmob').val();
jsondata.StudentMobile = $('#mob').val();
jsondata.PersonalEmail = $('#peid').val();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebForm1.aspx/InsertData",
datatype: "json",
async: false,
data:'{ud:' +JSON.stringify(jsondata)+'}',
success: function (Record) {
if (Record.d == true) {
$('#Result').text("Your Record insert").css('background-color','green');
}
else {
$('#Result').text("Your Record Not Insert").css('background-color','red');
}
},
Error: function (textMsg) {
$('#Result').text("Error: " + Error);
}
});
}
});
$("#datepicker").datepicker({
autoclose: true,
todayHighlight: true,
}).datepicker('update', new Date()).datepicker("setDate", null);
});
这是我完整的 jquery 代码
关于jquery - Datepicker 正在显示,但其中的日历被扭曲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39263005/
以下代码在2端口上监听,当有消息时修改全局dict对象。并且有一个计时器也会修改字典。 d = {} class x(Protocol): def dataReceived(self, dat
Twisted 怎么样?知道函数应该以异步方式执行吗? 异步函数应该返回一个带有call-/errbacks的Deferred(immeadiately),当收到“异步”数据时将被调用。接收到的数据作
我扭曲了服务器。它与插件一起运行。我想根据请求为每个条目编写唯一的前缀。 这意味着当user1发出请求时,它将生成一个唯一的字符串,该字符串将以日志记录为前缀(仅用于此请求)。当user2发出请求时,
我正在使用校准的立体声对进行稀疏重建。这是我一步一步采取的方法: 1- 我使用 MATLAB 中的立体相机校准器应用程序校准了我的立体相机。 2-我拍摄了一对立体图像,并对每个图像进行了不失真处理。
我关注了这个tutorial但我不知道如何从服务器获取响应数据。 class Service(Resource): def render_POST(self, request):
我的网站上有一个页面,它从数据库中获取大量图像并将它们放在一个网格中。 图像的形状和大小各不相同。 我想要做的是显示图像,每个图像都具有相同的宽度和高度,但不会扭曲。 现在我的CSS是 .image{
我正在尝试创建一个简单的代金券程序。 客户端连接到服务器并询问凭证上是否还有时间,如果是,服务器会响应多少时间。 我控制服务器和客户端,客户端也由我编写代码。 现在这就是我的服务器端,客户端是不言自明
假设我通过 TCP 连接快速接收数据。我必须对其进行某种处理。因为我不想阻塞 react 器线程,所以我将处理卸载到后台线程。 数据到达的速度超过了我处理它的速度。如果我将数据放入队列中,队列会无限增
我有一个简单的客户端,它向服务器发送请求并接收响应: from StringIO import StringIO from twisted.internet import reactor fro
我目前正在使用 python/twisted 构建一个 http 服务器。 该服务器必须在另一个 Web 服务器上获取内容,将其存储在本地并将响应发送回客户端。如果遇到 404,它必须尝试提供本地文件
我有一个扭曲的 react 堆监听传入的数据。我有第二个 react 器在特定时间间隔执行 http 请求,将结果发送到第一个 react 器。两者都运行良好。 现在我想把它放在一起在一个 react
我正在尝试使用 ImageMagick 的透视 功能。我看过这些例子,但我无法理解值对应的是什么。我有这段代码: var stream = new MemoryStream(); using (Mag
我有一个应用程序的想法,该应用程序采用每个角落有四个正方形的打印页面,并允许您在至少有两个正方形可见的情况下测量纸上的对象。我希望能够让用户从不太完美的角度拍照,但仍能准确测量物体。 由于我在该领域缺
我试图让用户在文本框中输入文本,并让程序生成所有可能的组合,但最少 3 个字符和最多 6 个字符除外。我不需要像 ' 这样的无用词as'、'a'、'i'、'to' 等弄乱了我的阵列。我还将根据字典检查
给定一个包含 +ve 和 -ve 整数的数组,找出不允许跳过 2 个连续元素的最大总和(即,您必须至少选择其中一个才能向前移动)。 例如:- 10、20、30、-10、-50、40、-50、-1、-3
什么时候应该使用 twisted.python.failure.Failure,什么时候应该使用 twisted.internet.error.ConnectionDone?或者我应该做 twiste
在 Twisted 中有 1 天的经验,我尝试安排消息发送以回复 tcp 客户端: import os, sys, time from twisted.internet import protocol
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
更新:为了便于阅读,这里是如何在 react 器关闭之前添加回调: reactor.addSystemEventTrigger('before', 'shutdown', callable) 原始问题
所以我已经查看了一些涉及使用 python 和 Twisted 框架编写 HTTP 代理的事情。 基本上,就像其他一些问题一样,我希望能够修改将发送回浏览器的数据。也就是说,浏览器请求资源,代理将获取
我是一名优秀的程序员,十分优秀!