Save method
function OnSave () {
Form validation
if (!$ (' #mainForm '). Validate (). form ()) {
return false;
}
$ ("#55"). Removeattr ("Disabled"); //select drop-down box is set to not selectable, the Save method is cleared again, you can save the value to the database
var para = $ ("#mainForm"). Serialize ();
$.post (' 22/11/33/44 ', para, function (result, status) {
if (result. Message = = "Save succeeded") {//This is the popup layer and the Close method after the Click Save button that is set when the Window.top top level pops up
Layer.alert ("Save succeeded", {
closebtn:0,//whether the Close button is displayed
Yes:function () {
OnCancel (); //Call return method
}
});
}
});
}
function OnCancel () {
var index = Parent.layer.getFrameIndex (window.name); Get the index of the current IFRAME layer first
Parent.layer.close (index); Then perform the close
}
When the edit page pops up at the outermost level, the popup layer is closed and the index page is refreshed, and you need to add this last in the Save method of index
End:function () {//Refresh interface
Location.reload ();
}
When modifying data on the edit page, click Save or add a piece of data because no field with ID added
<input type= "hidden" id= "id" name= "id" value= "${o.id}"/>
This article is from the "http://82711020.blog.51cto.com/12993840/1982230" blog, please be sure to keep this source.
Edit Page JSP interface some issues and considerations