Heim  >  Artikel  >  Web-Frontend  >  form表单action提交的js部分与html部分_javascript技巧

form表单action提交的js部分与html部分_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:05:051628Durchsuche
1、JS部分代码
复制代码 代码如下:

/**
* 提交表单
*/
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();//检查输入项是否为空
} ,
success:function(data){
if (data == "success"){
$.messager.alert('提示','
日志发表成功!','info');
}else{

$.messager.alert('提示','
日志发表失败!','warning');
}
}
});
}
/**
* 发表日志
*/
function publishBlog() {
submitForm("http://localhost:8090/webplus3/_web/sns/createBlog.do?_p=YXM9Mw__","发表","日志","fm1","publish");
}

2、html部分
复制代码 代码如下:



标题:



内容:




Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn