Why is it when i have this format for datepicker, a from submits correctly
$(function() {
$( "#datepicker" ).datepicker({
inline: true, 
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dateFormat: 'yy-mm-dd'
});
});
but as soon as i use the following date format
$(function() {
$( "#datepicker" ).datepicker({
inline: true, 
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
dateFormat: 'dd-mm-yy'
});
});
the form does not submit, instead it opens the datepicker calender again. All i have done is changed the dd and yy around.
All of the scripts on the page
$(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 = "";
        }
    }); 
