1. Parte del código JS
Copiar código del código de la siguiente manera:
/**
* Enviar el formulario
*/
Función SubmitForm (Action, ActName, Objname, FormName, BlogType) {
$ ("#"+FormName) .Attr ("Acción", Acción);
// var f = document.getElementsByTagName ("Forma") [0];
// alerta (F.Action);
$ ("#"+formname) .Form ({
onsubmit: functer () {
checkInput (); / verificar si el elemento de entrada está vacío
},
Éxito: function (data) {
if (data == "éxito") {{
$ .Messager.alert ('indicador', '<br> registra con éxito!', 'Info');
} Demás {
$ .Messager.alert ('consejos', '<br> falló los registros!', 'Advertencia');
}
}
});
}
/**
* Publicado un registro
*/
fufblishblog () {
SubtForm ("http: // localhost: 8090/webplus3/_web/sns/createBlog.do?
}
2. Parte de HTML
Copiar código del código de la siguiente manera:
<Form style = "Padding: 10px 8px;"
<div style = "margin-bottom: 10px;">
<span style = "Padding-Right: 10px;"> Título: </span>
<input type = "text" id = "title" name = "blog.tital" maxLength = "30">
</div>
<div style = "margin-bottom: 10px;">
<span style = "Padding-Right: 10px;"> Contenido: </span>
<input type = "text" id = "content" name = "blog.content" maxLength = "3000">
</div>
<Button type = "Subt" id = "SaveBlogButton" onClick = "PublicishBlog ()">
<span> publicado </span>
</botón>
</form>