You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by VIKASS NAGPAL <vi...@yahoo.com> on 2006/04/26 15:51:40 UTC

Default my Enter key into the OK button of the Login screen

Hi All,

I have a login screen that prompts for userid and
password. But when you press enter after inputing
these fields it does not "defaults" to Ok button. So I
want to "default" the button press event of "Enter"
button into action perform event of "OK" button. Can
anyone hint me regarding this. I would really
appreciate your help.

Thanks,
Vikas Nagpal.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Default my Enter key into the OK button of the Login screen

Posted by Marc Farrow <ma...@gmail.com>.
This is an HTML question.

Is the button in a FORM tag?  If not, then you will have to handle the
"button-pressed" event with javascript and then submit the page if it is an
enter key.



On 4/26/06, VIKASS NAGPAL <vi...@yahoo.com> wrote:
>
> Hi All,
>
> I have a login screen that prompts for userid and
> password. But when you press enter after inputing
> these fields it does not "defaults" to Ok button. So I
> want to "default" the button press event of "Enter"
> button into action perform event of "OK" button. Can
> anyone hint me regarding this. I would really
> appreciate your help.
>
> Thanks,
> Vikas Nagpal.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


--
Marc Farrow

Re: Default my Enter key into the OK button of the Login screen

Posted by Oliver Schoenwald <ol...@FernUni-Hagen.de>.
Hi,

if you use a (x)html-formular to create the login screen, you can
add a hidden input-field that contains the OK-Parameter (the same
parameter-name and parameter-value as the OK-Button). So, when
you hit "Return" OR the submit-button in that formular, the OK-Parameter
is send in both cases (when hitting return, the submit-button is not used
and the parameter of that input-element is not send with the other
formular-parameters, at least when you use pur (x)html. Maybe there
is a tweak with JavaScript, but I avoid these because of security and
accessibility issues).

However, when your Login-Formular contains
something like a 'cancel'-Button which starts another Action after 
submission,
this button has to send its own and unique
'cancel'-parameter  so that the application which handles the
login-request can recognize the difference between a submitted or a
canceled login-request and act accordingly.

Hope this helps and you could follow me,

Oliver Schönwald.

VIKASS NAGPAL schrieb:

>Hi All,
>
>I have a login screen that prompts for userid and
>password. But when you press enter after inputing
>these fields it does not "defaults" to Ok button. So I
>want to "default" the button press event of "Enter"
>button into action perform event of "OK" button. Can
>anyone hint me regarding this. I would really
>appreciate your help.
>
>Thanks,
>Vikas Nagpal.
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org