1. جزء من رمز JS
نسخ رمز رمز على النحو التالي:
/**
* إرسال النموذج
*/
وظيفة إرسال (الإجراء ، ActName ، ObjName ، FormName ، BlogType) {
$ ("#"+formName) .ATTR ("الإجراء" ، العمل) ؛
// var f = document.getElementSbyTagName ("form") [0] ؛
// ALERT (F.Action) ؛
$ ("#"+formname) .form ({
onsubmit: function () {
CheckInput () ؛
} ،
النجاح: الوظيفة (البيانات) {
if (data == "النجاح") {{
$ .messager.alert ('form' ، '<br> سجلات بنجاح!' ، 'info') ؛
} آخر {
$ .messager.alert ('Tips' ، '<br> فشل سجلات!' ، "تحذير") ؛
}
}
}) ؛
}
/**
* نشر سجل
*/
fublishblog () {
إرسال ("http: // localhost: 8090/webplus3/_web/sns/createBlog.do؟
}
2. جزء HTML
نسخ رمز رمز على النحو التالي:
<النماذج النمط = "الحشو: 10px 8px ؛"
<div style = "margin-bottom: 10px ؛">
<span style = "Padding-Right: 10px ؛"> العنوان: </span>
<type type = "text" id = "title" name = "blog.tital" maxLength = "30">
</div>
<div style = "margin-bottom: 10px ؛">
<span style = "Padding-Right: 10px ؛"> المحتوى: </span>
<type type = "text" id = "content" name = "blog.content" maxLength = "3000">
</div>
<button type = "submit" id = "saveBlogButton" onClick = "publicishblog ()">
<span> نشر </span>
</button>
</form>