Form form Action Submission JS part and HTML part

Source: Internet
Author: User

  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>   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.