Luis Martín Canaval Sánchez wrote:
> 
> I would like to know that aswell, so far I have been using javascript with
> jquery that is the lib that I use
> 
> 
> // somewhere inside the initial function
> $("input:text:visible:first").focus();
> // or
> $("#othercontol").focus();
> // if the first control is not a textbox.
> 
> On Mon, May 10, 2010 at 15:52, Emi Lu <em...@encs.concordia.ca> wrote:
> 
>> Good afternoon,
>>
>> Struts1, I use <html:form focus="field_name" to focus a default field.
>>
>> For *struts2.1.8.1*, may I know the grammar of setting focus value for
>> "s:form" please?
>>
>> <s:form focus="field_name" > does not work.
> 
> 

I just use <body onload=xxxxxx> e.g;

<body onLoad="document.login.j_username.focus()">
<form action="j_spring_security_check" method="post" name="login">
        
        
        <label for="j_username">Username</label>
<input type="text" name="j_username" id="j_username" value="<s:property
value="%{#session.SPRING_SECURITY_LAST_USERNAME}"/>"/>

-- 
View this message in context: 
http://old.nabble.com/how-to-set-default-focus-field-in-%3Cs%3Aform%3E---tp28516814p28532441.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to