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.