我有小问题
在表单提交
e.preventDefault();
不工作
代码:
$(function(){
$("#contact-form").submit(function(e){
Validation.init({
name : $("#contact-form").find("input[name='name']").val(),
phone : $("#contact-form").find("input[name='mobile']").val(),
mail : $("#contact-form").find("input[name='email']").val(),
text : $("#contact-form").find("textarea").val()
});
e.preventDefault();
});
});
提交页面重新加载后:(
HTML
<form id = "contact-form" action = "" method = "post">
<input type = "text" name = "name" placeholder="სახელი">
<input type = "text" name = "mobile" placeholder="მობილურის ნომერი">
<input type = "text" name = "email" placeholder="ემაილი">
<textarea name = "text" placeholder = "ტექსტი" ></textarea>
<input type = "submit" name = "submit" value = "გაგზავნა">
</form>
我认为问题是
Validation.init({
name : $("#contact-form").find("input[name='name']").val(),
phone : $("#contact-form").find("input[name='mobile']").val(),
mail : $("#contact-form").find("input[name='email']").val(),
text : $("#contact-form").find("textarea").val()
});