添加此.js文件后
<script src="jQueryAssets/jquery-1.11.1.min.js" type="text/javascript"></script>
到我的datepicking代码,我在另一个.js文件上的用户名验证ajax
<script src="jQueryAssets/jquery-1.2.6.min.js" type="text/javascript" ></script>
无效。我认为发生了一些冲突。当我删除jquery-1.2.6.min.js时,情况是一样的。但是,当我删除jquery-1.11.1.min.js日期选择器不工作,但formvalidstion ids工作.... !!
请帮助我,我是初学者
这是我的用户名验证ajax代码
<SCRIPT type="text/javascript">
pic1 = new Image(16, 16);
pic1.src = "loader.gif";
$(document).ready(function(){
$("#wo_no").change(function() {
var usr = $("#wo_no").val();
if(usr.length >= 3)
{
$("#status").html('<img src="loader.gif" align="absmiddle"> Checking availability...');
$.ajax({
type: "POST",
url: "check.php",
data: "wo_no="+ usr,
success: function(msg){
$("#status").ajaxComplete(function(event, request, settings){
if(msg == 'OK')
{
$("#wo_no").removeClass('object_error'); // if necessary
$("#wo_no").addClass("object_ok");
$(this).html(' <img src="tick.gif" align="absmiddle">');
}
else
{
$("#wo_no").removeClass('object_ok'); // if necessary
$("#wo_no").addClass("object_error");
$(this).html(msg);
}
});
}
});
}
else
{
$("#status").html('<font color="red">Work order number should be atleast <strong>3</strong> characters.</font>');
$("#wo_no").removeClass('object_ok'); // if necessary
$("#wo_no").addClass("object_error");
}
});
});
</SCRIPT>
这是表格的代码
<form action='' method='POST' name='registerform' id='registerform'>
<table width="93%" border="0" class='tablestr'>
<tr>
<td width="22%" ><div class='tabdata' align="right"> Work Order No: </div></td>
<td width="38%" ><input class='tfield' id="wo_no" size="20" type="text" name="wo_no" required='required' ></td>
<td width="40%" align="left"><div class='tfield' id="status"></div></td>
</tr>
<tr>
<td ><div class='tabdata' align="right"> Date of job (Plan): </div></td>
<td ><input class='tfield' type="text" id="date_plan" name="dateplan"></td>
</tr>
<tr>
<td ><input name='Create' type='submit' class='button' id='Create' value='Create Job'></td>
</tr>
最后一个日期选择器
<script type="text/javascript">
$(function() {
$( "#date_plan" ).datepicker();
});
</script>