This article is mainly to the JS Event Interception enter Button page submission event sample code is introduced, the need for friends can come to the reference, I hope to help you
If you press Enter in a text box to let him execute a JS function, but do not want to submit the form, you can do this:
function Ysearch ()///Year text box return key Reload DataWindow
{
Validateinputtext (' yyyy ');//Want to do the first JS function
if (event.keycode==13)
{
Changeym ()//Want to do the second JS function, finished to empty the event
event.returnvalue=false;//the event to intercept, the form can not get event.keycode==13
}
}
runat= "Server" class= "CRBT_INPUT1" >
Hint, if in an event, you want to call two JS functions, such as the Validateinputtext (' yyyy ') called in the onkeydown event; and Changeym () function, then you can write them both in a function ysearch (), and then call the Total function Ysearch ().