The first way: Submit button Submission
<form action= "Mydemand" method= "POST" >
<span> keyword:</span> <input name=
"keywords" type= "Text" value= "@keywords"/>
<input type= "Submit" value= "search"/>
</form>
The second way: $ ("#dataform"). Ajaxsubmit () Submit
<form id= "DataForm" action= "Updateuserinfo" enctype= "Multipart/form-data" method= "POST" > <table style= " width:100%;border:0; "cellpadding=" 0 "cellspacing=" 0 "> <tbody> <tr> <td width=" "> Name: </TD > <td><input type= "text" name= "Nvc_name" id= "Nvc_name" value= "@Model. Nvc_name"/></td> </tr > <tr> <td colspan= "2" align= "center" > <input type= "button" value= "Save" id= "Btnsubmit"/> </td > </tr> </tbody> </table> </form> <script src= "http://code.jquery.com/ Jquery-1.11.0.min.js "></script> <script src=" Http://malsup.github.io/jquery.form.js "></script >//ajaxform Dependent script <script type= "Text/javascript" > $ (document). Ready (function () {$ ("#btnsubmit"). Click (
function () {if ($ ("[name= ' Nvc_name ']"). val () = "") {alert ("Please fill in the name");
$ ("[name= ' Nvc_name ']"). focus ();
Return
$ ("#dataform"). Ajaxsubmit (function (r) {alert (r.msg); if (r.success) {location.reload ();}})
});</script>
The Third Way: Post submission
<table style= "width:100%;border:0px" cellpadding= "0" cellspacing= "0" >
<tbody>
<tr>
<td width= "15%" align= "right" > Mobile number:</td> <td><input
"text" type= "Please enter your mobile number" Id= "Nvc_user_name"/></td>
</tr>
<tr>
<td colspan= "2" align= "Center" >
<input type= "button" value= "Save" id= "Btnsubmit"/>
</td>
</tr>
</tbody >
</table>
<script type= "Text/javascript" >
$ (function () {
$ ("#btnsubmit"). Click (function () {
var nvc_user_name = document.getElementById (' nvc_user_name ');
$.post ('/interface/modefiypwd ', {
nvc_user_name:nvc_user_name.value,
}, function (data) {
if ( data.success) {
$ ("#successdiv"). Show ();
$ ("#editdiv"). Hide ();
else {
layer.msg (data. MSG);
}
}
); </script>
The above is a small set to introduce the MVC in the form of forms submitted in three ways (recommended), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!