The statement has to say "return false", and your onclick event has to say
"return CheckKey();".
Also, this is just a plain submit to the server, this is not related to the
autopostback that can happen with a dropdown.
"Domien Holthof" <do************@alcopa2wheels.com> wrote in message
news:09****************************@phx.gbl...
Hi Ravikanth,
I didn't realy understood what you meant, so I tried to
make the function look like this:
function CheckKey()
{
... // My code to check the key and do stuff...
return;
}
That didn't solve it. Next I tried this :
function CheckKey()
{
... // My code to check the key and do stuff...
return false;
}
That didn't do the trick either. But could anyone tell
WHAT is causing the postback and how to prevent it?
Thanx,
Domien
-----Original Message-----
Hi Domien
Just use return; statement in your javascript function.
HTH
Ravikanth
-----Original Message-----
Hi,
I'm having a straight HTML <input type="text"
onkeypress="CheckKey();"> within a <form
runat="server">.When I press ENTER when in the textbox, the client-side
CheckKey() function is executed but still the form or
pageseems to do an AutoPostBack to the server.
Any ideas on how to avoid this postback?
Thanx a lot in advance,
Domien
.
.