A brief analysis of _javascript skills in JavaScript implementation of automatic filling form examples

Source: Internet
Author: User

This article gives an example of how JavaScript implements the automatic filling out form. Share to everyone for your reference, specific as follows:

In peacetime development process, or visit some sites, often to fill a large pile of forms, we can use JavaScript, write a script, in advance to fill in the information ready, and then simulate the Click button action, automatic submission of forms, easy and efficient.

Steps

1. Locate the corresponding form in the page and list the HTML controls you want in the form, such as

<form name= "Customersform" id= "MyForm" method= "POST" action= "insert.php" >
  <b> Last Name: </b> <input Type= "text" name= "Thisfnamefield" size= "value=" ">
  <b> Name: </b> <input type=" text "Name=" Thislnamefield "size=" "value=" ">
  <b> Company: </b> <input type=" text "name=" Thiscompanyfield "size = "Value=" "> 
  <b> Address: </b> <input type=" text "name=" Thisaddressfield "size=" value= "" >< C5/></form>

2. Write JS code

Copy Code code as follows:
Javascript:customersForm.thisFnameField.value = "Zhang"; customersForm.thisLnameField.value = "three"; CustomersForm.thisCompanyField.value = "Company"; customersForm.thisAddressField.value = "China"; customersForm.submit.focus ();

3. The third step is the most important, because the first 2 steps a little bit of JS knowledge people will write such a simple code. The next step is to use the browser's Favorites (bookmarks) function to register the JS code.

Take Chrome as an example, right-click on the bookmark ———— > Add page, Name fill in "Automatic fill in", url fill "above that section JS code", and then save.

4. Test it.

Open the page in the browser and click "Auto Fill" in the Bookmarks bar, and you'll be surprised to find that the form has been filled in.

I hope this article will help you with JavaScript programming.

Related Article

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.