0
使用AJAX将表单值传递到PHP页面。一旦通过值,我将清除表单中INPUT字段的值。它工作正常,但是当我清除输入:日期值页面得到刷新!页面在日期刷新重置
$('#form1').submit(function(){
var formdata = $(this).serialize();
$.ajax({
type:'POST',
url:'certification.php',
data:formdata
});
$(this).find('input:text').val('');
$(this).find('input:file').val('');
$(this).find('input:date').val(''); **On adding this line page gets Refreshed.**
return false;
});
替换此: '$(本).find( '输入:日期')VAL( '')。 ' 这样: '$(this).find('input [type =“date”]')。val('');' 并重试。 – 2013-05-08 04:31:43
很酷,这工作正常。 – sakthi 2013-05-08 04:37:42