为什么当我有这种日期选择器格式时,来自正确提交
$(function() {
$( "#datepicker" ).datepicker({
inline: true,
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dateFormat: 'yy-mm-dd'
});
});
但是一旦我使用以下日期格式
$(function() {
$( "#datepicker" ).datepicker({
inline: true,
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dateFormat: 'dd-mm-yy'
});
});
表单没有提交,而是再次打开 datepicker 日历。我所做的只是改变了 dd 和 yy 。
页面上的所有脚本
$(document).ready(function() {
<?
if ($Fchk===1) {
?>
$('#newCus').show();
$('#delivery').hide();
$('#sDel').show();
<?
} else {
?>
$('#newCus').hide();
$('#delivery').hide();
$('#sDel').hide();
<?
}
?>
$('#seldate').hide();
$('seldelopt').show();
$("#ncus").validate({
debug: false,
submitHandler: function(form) {
$.post('order_new.php', $("#ncus").serialize(), function(data) {
$('#mainBody').html(data);
$("#mainBody").find("script").each(function(i) {
eval($(this).text());
});
});
}
});
$("#setDel").click(function() {
if($('#setDel').is(':checked')) {
$('#delivery').fadeIn('slow')
} else {
$('#delivery').fadeOut('slow')
document.getElementById("delAddress").value = ""
if ($('#delAddress1').length ) {
document.getElementById("delAddress1").value = "";
}
if ($('#delAddress2').length ){
document.getElementById("delAddress2").value = "";
}
if ($('#delAddress3').length ) {
document.getElementById("delAddress3").value = "";
}
if ($('#delAddress4').length ) {
document.getElementById("delAddress4").value = "";
}
document.getElementById("delTown").value = ""
document.getElementById("delCounty").value = ""
document.getElementById("delpostcode").value = "";
}
});
$('input:radio[name="dDate"]').change(function(){
if($(this).val()==1) {
alert($(this).val());
} else {
$('#seldelopt').fadeOut('fast')
$('#seldate').fadeIn('fast');
}
});
$("#enable").click(function() {
if($('#enable').is(':checked')) {
$('select[name="cusID"]').attr('disabled', 'disabled');
$('#sDel').fadeIn('slow')
$('#newCus').fadeIn('slow');
} else {
$('select[name="cusID"]').removeAttr('disabled');
$('#sDel').fadeOut('slow')
$('#newCus').fadeOut('slow')
}
});
});
$(function() {
$( "#datepicker" ).datepicker({
inline: true,
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dateFormat: 'yy-mm-dd'
});
});
$("#datepicker").click(function() {
if ($('#datepicker').length ) {
document.getElementById("datepicker").value = "";
}
});