這是我的表單,我只需要在ajax中提交這個表單。我想只是與阿賈克斯在提交簡單的HTML 我總代碼工作正常,我必須與阿賈克斯沒有別的用Ajax提交表單
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script>
$(function() {
$("#register-form").validate({
rules: {
name: "required",
email: {
required: true,
email: true
},
Budget: {
required: true,
},
phone:"required",
budget:"required",
agree: "required"
},
messages: {
name: "Please enter your Name",
email: "Please enter a valid Email address",
phone: "Please enter a valid Phone Number",
Budget: "Please Select a Budget",
agree: "Please accept our policy"
},
submitHandler: function(form) {
alert("success");
form.submit();
}
});
});
</script>
</head>
<body>
<form action="" method="post" id="register-form" novalidate="novalidate">
<div class="label">Name</div><input type="text" id="name" name="name" /><br />
<div class="label">Email</div><input type="text" id="email" name="email" /><br />
<div class="label">Phone Number</div><input type="text" id="phone" name="phone" /><br />
<div class="label">budget</div>
<select id="Budget" name="Budget">
<option value="">select</option>
<option value="1">0-100</option> <!-- first option contains value="" -->
<option value="2">100-200</option>
<option value="3">200-300</option>
</select>
<br />
<div style="margin-left:140px;"><input type="submit" name="submit" value="Submit" /></div>
</form>
</body>
這是我的形式我只需要在AJAX提交此提交。我只想提交與簡單的HTML中的AJAX 我的總代碼工作正常我必須提交與AJAX沒有其他
你嘗試過什麼嗎? –
沒有什麼只是做一個處理函數提交我必須做提交ajax – user3292597
顯示一些辛苦工作和代碼爲ajax我們將很樂意幫助您' –