The specified url_HTML/Xhtml _ webpage cannot be displayed when the button does not specify the type as submit.

Source: Internet
Author: User
Due to project requirements, the submission of the js control form is required. data verification and processing are performed before the submit. The buttons in ie6 and ie7 are not reflected, and the specified url cannot be redirected, other browsers can jump normally and always think that there is a problem in the js control code, so the tracing and debugging has not been found for a long time. Later, it was found that the button did not specify the type as submit. Due to project requirements today, JavaScript needs to control form submission, and data verification and processing will be performed before submit.

The html code is as follows::

The Code is as follows:



Mobile phone number



After encoding is complete, the compatibility test of the browser has encountered a problem: ie6 or ie7 does not reflect the button, and the specified url cannot be redirected, but other browsers can jump normally.
I always thought that there was a problem in the js control code, so I have been tracking and debugging for a long time and have never found any problems. Later, we found that the type of the button is not specified as submit, So we suspect that this problem is true.
After the type attribute of the added button is changed to submit, ie6 and ie7 functions normally.

I have never paid attention to such a problem in the past, so I went to search for materials for verification.
The type attribute of the button is described in detail on w3shool.:
Http://www.jb51.net/w3school/tags/att_button_type.htm

The Code is as follows:


Define and use the type property to specify the type of the button. Tip: always define the type attribute for the button. The default type of Internet Explorer is "button", while that of other browsers (including W3C specifications) is "submit ". It can be seen that the form will be submitted after the default button is clicked in other browsers, while the form will not be submitted after ie click by default. The default value of type is also a browser compatibility problem, so mark.

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.