1. JS part code
/ **
* Submit form
*/
function submitForm(action, actName, objName, formName,blogType){
$("#" formName).attr("action",action);
//var f = document.getElementsByTagName("form")[0];
//alert(f.action);
$("#" formName).form({
onSubmit:function( ){
checkInput();//Check whether the input item is empty
},
success:function(data){
if (data == "success"){
$. messager.alert('prompt','
Log published successfully!','info');
}else{
$.messager.alert('prompt','
}
}
});
}
/**
* Post a blog
*/
function publishBlog() {
submitForm("http://localhost:8090/webplus3/_web/sns/createBlog.do?_p=YXM9Mw__","Publish","Log","fm1","publish");
}
2. html part