The server button event in the jquery pop-up layer is not triggered.

Source: Internet
Author: User

This is written today.CodeThe problem is: the server button event I added in the pop-up layer is not triggered in the pop-up layer?

View code

During debugging, the server event of btnadd is not triggered ..

After checking the information on the Internet, I found that the pop-up layer jumped out of the form form1 after being created by jquery, and all events on the server could not be executed.

Solution:

1. The setting button is not resolved to submit, and usesubmitbehavior = "false"

2. Use JS latency. click the button to close the pop-up layer before submitting the form.

Dialog. Close (); setTimeout (Function() {$ ("# Form1"). Submit () ;}, 10 );

3. When the pop-up layer is opened, append the pop-up layer to the form.

VaR $ dig = $ ("# adddiv"). Dialog ('open ');

$ Dig. Parent (). appendto (jquery ("form: First "));

1$ ('# Btnadd'). Click (Function(){2 Dialog. Close ();3SetTimeout (Function() {$ ("# Form1"). Submit () ;}, 10);4});

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.