CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 2 Submit Buttons, ENTER Activating Wrong One

Print topic Send  topic

Author Message
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.
>

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.