Chris Moore
|
Posted: 08/22/2003, 11:30 AM |
|
I have 2 Submit buttons on my login form. 1 is for signing up & the 2nd is
for logging in. When the user presses the ENTER button, I want the LOGIN
button to activate but since it is the 2nd button on the form, the SIGNUP
button always activates. How can I force the ENTER key to activate the
LOGIN button?
Thanks
Chris
|
|
|
DonB
|
Posted: 08/22/2003, 12:26 PM |
|
As far as I know, the only control you have is which order the buttons occur
in the html (top to bottom, the first one found becomes the default). The
"default" property on buttons doesn't do anything (at least in ASP). You
can alter focus in javascript, but then you have to figure out a way to
trigger the focus-change. Not much to go on there except tabbing out of a
field.
You might be able to utilize the onKeyUp event of the <INPUT> elements to
detect receipt of an "enter" keystroke and do what you want, but I think the
smart thing is to rearrange the buttons.
--
DonB
http://www.gotodon.com/ccbth
"Chris Moore" <chris@dblayout.com> wrote in message
news:Xns93DF89D91611Bcabubba@66.180.229.147...
> I have 2 Submit buttons on my login form. 1 is for signing up & the 2nd is
> for logging in. When the user presses the ENTER button, I want the LOGIN
> button to activate but since it is the 2nd button on the form, the SIGNUP
> button always activates. How can I force the ENTER key to activate the
> LOGIN button?
>
> Thanks
>
> Chris
|
|
|
Chris Moore
|
Posted: 08/22/2003, 12:37 PM |
|
Well, I ended up just making a regular hyperlink under my Login form to
new users (I think thats the way most sites do it anyway) and now it
seems to work fine.
Thanks for the help.
Chris
"DonB" <~ccbth~@gotodon.com> wrote in
news:bi5qp6$6c0$1@news.codecharge.com:
> As far as I know, the only control you have is which order the buttons
> occur in the html (top to bottom, the first one found becomes the
> default). The "default" property on buttons doesn't do anything (at
> least in ASP). You can alter focus in javascript, but then you have
> to figure out a way to trigger the focus-change. Not much to go on
> there except tabbing out of a field.
>
> You might be able to utilize the onKeyUp event of the <INPUT> elements
> to detect receipt of an "enter" keystroke and do what you want, but I
> think the smart thing is to rearrange the buttons.
>
|
|
|
|
|