Js event screenshot enter button Page Submission event sample code
This article mainly introduces the sample code for submitting events on the enter page for js event interception. If you need it, you can refer to it for help.
If you press enter in a text box to let him execute a js function but don't want to submit the form, you can do this:
Function ysearch () // reload DataWindow
{
ValidateInputText ('yyyy'); // The first js function to be implemented
If (event. keyCode = 13)
{
Changeym (); // The second js function to be implemented. After completing the function, clear the event.
Event. returnValue = false; // when the event is intercepted, the form cannot get event. keyCode = 13.
}
}
Runat = "server" class = "CRBT_input1">
// Prompt: If you want to call two js functions in an event, for example, validateInputText ('yyyy') called in the onkeydown event; and changeym (); function, then you can write the two of them in a function ysearch () and then call the total function ysearch ().