Edit Page JSP interface some issues and considerations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.