I have a web form with a text box and a button. I want after "ENTER" to click on the postbak text box.
I am using the following code:
onkeypress=" if(event.keyCode==13)
{ alert(2);
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false));
alert(2);
return false;}
Where WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false));
is the javascript code for the onclick button event.
I get two warnings but postback does not occur.
Any ideas what is wrong?
Anton source
share