AutoPostBack question.

D

Domien Holthof

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 page
seems to do an AutoPostBack to the server.

Any ideas on how to avoid this postback?
Thanx a lot in advance,

Domien
 
R

Ravikanth[MVP]

Hi Domien

Just use return; statement in your javascript function.

HTH
Ravikanth
 
M

Marina

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top