The js and HTML sections of the form action submission

  • 2020-03-30 01:15:20
  • OfStack

1. JS part of the code
function submitForm(action, actName, objName, formName,blogType){ 
//var f = document.getElementsByTagName("form")[0]; 

checkInput();//Check that the input item is empty
} , 
if (data == "success"){ 
$.messager.alert(' prompt ','<br> Log published successfully !','info'); 

$.messager.alert(' prompt ','<br> Log publication failure !','warning'); 
function publishBlog() { 
submitForm("http://localhost:8090/webplus3/_web/sns/"," published "," The log ","fm1","publish"); 

2. HTML part
<form style="padding: 10px 8px;" method="post" action="" id="fm1" name="fm1"> 
<div style="margin-bottom: 10px;"> 
<span style="padding-right: 10px;"> The title :</span> 
<input type="text" id="title" name="blog.title" class="int_txt" maxlength="30"> 
<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"> 
<button class="btnstyle-strong btn-submit btn-submit-2" type="submit" title=" In the log (ctrl+enter)" id="saveBlogButton" onclick="publishBlog()"> 
<span> hair   table </span> 

Related articles: