Js event screenshot enter button Page Submission event sample code

Source: Internet
Author: User

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 ().

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.