You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Cenk <ce...@yahoo.com> on 2007/08/27 10:43:18 UTC

How to set focus to a textbox?

Hi,

i want to set focus to an input field on my index.jsp. But i could not 
manage...

Here is the code segment below:
...
<body>
	<form action="/Login" method="post">
          <table border="0">
             <tr>
                <td>Login:</td>
                <td><INPUT type="text" name="userId" /></td>
          </tr>
          <tr>
...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to set focus to a textbox?

Posted by Alvaro Sanchez-Mariscal <al...@gmail.com>.
<body onload="document,getElementById('userId').focus()">
...

<INPUT type="text" name="userId" id="userId"/>


Alvaro.



On 8/27/07, Cenk <ce...@yahoo.com> wrote:
> Hi,
>
> i want to set focus to an input field on my index.jsp. But i could not
> manage...
>
> Here is the code segment below:
> ...
> <body>
>         <form action="/Login" method="post">
>           <table border="0">
>              <tr>
>                 <td>Login:</td>
>                 <td><INPUT type="text" name="userId" /></td>
>           </tr>
>           <tr>
> ...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Alvaro Sanchez-Mariscal Arnaiz
Java EE Architect & Instructor
alvaro.sanchezmariscal@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org