Call the form object action between JavaScript webpages

Source: Internet
Author: User
In program development, a problem occurs: The content of "data table content example" and "corresponding field" needs to be dynamically changed based on the changes in the data table ,:

The data table code is as follows:
<Select name = "table_list" class = "an" id = "table_list"Onchange = "select_table ()">

Analysis:

We know that the "onchange" action is executed only when the option value of "table_list" is changed. Therefore, when the file is uploaded, the "table_list" option is refreshed, does not trigger its "onchange" action, so the content of "data table content example" and "corresponding field" does not reflect the actual data table information in a timely manner.

Solution:

Because I use a non-component upload, the webpage contains an IFRAME. After uploading a file using the relevant ASP file, use the following statement to call the "onchange" action of "table_list,
Response. Write "<script language =" "JavaScript" "type =" "text/JavaScript">"
Response. Write ("parent.doc ument. getelementbyid (" "table_list" "). onchange ()")
Response. Write ("</SCRIPT> ")

Conclusion:

In this example, we can see that using JavaScript can call the form object action between webpages, making our Webpage Programs more humane.

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.