Enter key press and button OnClick event firing

wan2fly99

Registered User.
Local time
Today, 07:22
Joined
Feb 7, 2005
Messages
53
Have a form with a button and some text fields on it


When I hit enter after filling a field the event for the button fires up event onClick

How can I get around this since on one of the fields I have a textchangeEvent I to fire up


Why would this occurs?
 

SOS

Registered Lunatic
Local time
Today, 07:22
Joined
Aug 27, 2008
Messages
3,517
Have you set the DEFAULT property of the button to YES? If so, change it to NO.
 

wan2fly99

Registered User.
Local time
Today, 07:22
Joined
Feb 7, 2005
Messages
53
I am using visual web developer right click the button and properties comes up

where would this property be I don't see anything that says default

Thanks for anymore help
 

SOS

Registered Lunatic
Local time
Today, 07:22
Joined
Aug 27, 2008
Messages
3,517
Since I don't have that available right now, I'm not sure.
 

wan2fly99

Registered User.
Local time
Today, 07:22
Joined
Feb 7, 2005
Messages
53
Okay changed this property: UseSubmitBehavior = false

now when I hit enter it does not go in my button on_click event

Another one:
when ever you hit <enter> it always goes to the server?
seems like it will execute load_page event,
any txtLoadEvent?

I noticed I can check if it is a postback and not execute code I don't want

Is this the correct thinking?
 

Users who are viewing this thread

Top Bottom