Use javascript to submit form method summary

Source: Internet
Author: User

Use javascript to submit form method summary

This article mainly introduces how to submit a form through the hyperlink of the tag. It is very comprehensive, meticulous, and practical. If you need it, you can refer to it.

I will not talk much about it. I will directly discuss the content.

?

1

2

3

4

5

6

7

8

<Form action = "/home/search" method = "get" id = "search_form">

<Div class = "searchBox png" id = "searchBox">

<Input type = "text" id = "searchTxt" class = "searchTxt" name = "shopName" value = "@ shopName">

<

Class = "searchPic h-submitBtn png" id = "h-submitBtn" onclick = "document: search_form.submit ();">

</A>

</Div>

</Form>

There are several ways to write:

1.

<A class = "searchPic h-submitBtn png" id = "h-submitBtn" onclick = "document: search_form.submit ();"> submit </a>

2.

<A href = "javascript: document: search_form.submit ();"> submit </a>

3.

<A class = "searchPic h-submitBtn png" id = "h-submitBtn" onclick = "document. getElementById ('search _ form '). submit (); "> submit </a>

The above is a summary of several methods. I hope it will be helpful for you to learn about js.

 

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.