JS:
1
function
enterSubmit(src,e)
2 {
3 if(window.event)
4 keyPressed = window.event.keyCode; // IE
5 else
6 keyPressed = e.which; // Firefox
7 if(keyPressed==13)
8 {
9 submitForm();
10 return false;
11 }
12 }
13 function submitForm()
14 {
15 var obj = document.getElementById('MyMaster_DemoPageInput_goButton');
16 obj.click();
17 }
HTML:
2 {
3 if(window.event)
4 keyPressed = window.event.keyCode; // IE
5 else
6 keyPressed = e.which; // Firefox
7 if(keyPressed==13)
8 {
9 submitForm();
10 return false;
11 }
12 }
13 function submitForm()
14 {
15 var obj = document.getElementById('MyMaster_DemoPageInput_goButton');
16 obj.click();
17 }
<
asp:TextBox ID
=
"
keyinput
"
onkeydown
=
"
return enterSubmit(this,event);
"
runat
=
"
server
"
><
/
asp:TextBox>