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.