Type = button is simply a Button Function
Type = submit is the sending form
However, people engaged in Web UI should note that using submit to improve the ease of use of pages:
After the submit is used, the page supports the Enter key operation. Many Web software designers may not notice that the submit is uniform. After the button is used, the page usually does not support the Enter key. Therefore, the Enter key must be supported and a submit must be set. The default enter key is used to operate the first submit on the page.
======================================
<Input type = "Submit" name = "B1" value = "Submit" onclick = "bt_submit_onclick ()">
After onclick is executed, go to action. Onclick is not required for automatic submission. So onclick can be avoided here.
<Input type = "button" name = "B1" value = "Submit" onclick = "bt_submit_onclick ()">
After onclick is executed, the jump file is controlled in the JS file. Onclick is required for submission. For example: 1, onclick = "form1.action = 'a. jsp '; form1.submit ();" to implement the submit function. 2, <form name = "form1" method = "Post" Action = "http://www.sina.com.cn">
<Input type = "button" name = "button" value = "button" onclick = "Submit ()">
</Form> 3, <input type = "button" name = "button" value = "button" onclick = "javascript: Windows. location. href = "your url"> JS page Jump methods:
First:
<Script language = "JavaScript" type = "text/JavaScript">
Window. Location. href = "login. jsp? Backurl = "+ window. Location. href;
</SCRIPT>
Second:
<Script language = "JavaScript">
Alert ("return ");
Window. History. Back (-1 );
</SCRIPT>
Third:
<Script language = "JavaScript">
Window. navigate ("Top. jsp ");
</SCRIPT>
Fourth:
<Script language = "JavaScript">
Self.location+'top.htm ';
</SCRIPT>
Category 5:
<Script language = "JavaScript">
Alert ("illegal access! ");
Top. Location = 'xx. jsp ';
</SCRIPT>
From: http://hi.baidu.com/liliuqing/blog/item/e0b9e22cc4613fe88b13994a.html