Everyone to the form of action submitted some understanding, the following for you to implement the JS section and HTML section, interested friends can refer to the following
1, JS part of the code Code as follows:/** * Submit form */ function submitform (action, Actname, objname, Formname,blogtype) {&N Bsp $ ("#" +formname). attr ("action", action); //var f = document.getelementsbytagname ("form") [0]; // Alert (f.action); $ ("#" +formname). Form ({ onsubmit:function () { checkinput ();//Check whether the entry is empty }, Success:function (data) { if (data = = "Success") { $.messager.alert (' Hint ', ' <br> log published successfully! ', ' info ') ; }else{ $.messager.alert (' hint ', ' <br> log publish failed! ', ' warning '); } } }); } /** * Publish log */ function Publishblog () { submitform ("http://localhost:8090/webplus3/_web/ Sns/createblog.do?_p=yxm9mw__ "," Publish "," Log "," FM1 "," Publish "); } 2, HTML part Copy code code as follows: <form style= "padding:10px 8px" method= "post" action= "id=" FM1 "name=" FM1 "> <div style=" margin-bottom:10px " > <span style= "padding-right:10px;" > Title:</span> <input type= "text" id= "title" Name= "Blog.title" class= "Int_txt" maxlength= "" > </div> <div style= "margin-bottom:10px;" > <span style= "padding-right:10px;" > Content:</span> <input type= "text" id= "content" Name= "blog.content" class= "Int_txt" maxlength= "3000" > </div> <button class= "Btnstyle-strong btn-submit btn-submit-2" type= "Submit" title= "Post log ( Ctrl+enter) "id=" Saveblogbutton "onclick=" Publishblog () "> <span> publishing </span> </button > </form>