When you focus on the Text input box, press the Enter key to refresh the reason and solution of the page. The text input box

Source: Internet
Author: User

When you focus on the Text input box, press the Enter key to refresh the reason and solution of the page. The text input box

If there is only one input box in a form, when the input box gets the focus, click Enter, and the entire page will be refreshed. solution.

1. Process form
Add an event to form <form onsubmit = " return false;">.......</form>
2. Add a hidden input box to change a single input box.
<input id="hiddenText" type="text" style="display:none" /> 3. shield the Enter key
1> remove the carriage return event globally function document.onkeydown() {Var e = event. srcElement; if (event. keyCode = 13) {return false ;}}
2> remove the carriage return event from the input box. onkeydown = "return ClearSubmit (event )"
<Input type = "text" onkeydown = "return ClearSubmit (event)"/>
Function ClearSubmit (e) {if (e. keyCode = 13) {return false ;}}
Refreshing a Textbox page on the Web

You have not set a partial refresh. clicking the Enter key is definitely refreshing the entire page. Does your input box belong to the server or the client? If it is a server, that is, <Textbox>, you can use updatepanel to set local refresh ~

When Baidu search enters text, press the Enter key to flash in front of the computer. No need to click the mouse. Some words are entered, press the Enter key, and then open again.

Use 360 to fix browser problems. If you try another browser, use 360.

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.