You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Omer Basar <om...@gmail.com> on 2007/01/28 04:27:00 UTC

[S2] Putting a single html input type="text"

Hi all,

I just wondering if I can put a single html input to the form without a
label, td's and tr's.
The <s:textfield name="name"> generates the html code

<td class="tdLabel"></td>
    <td><input name="name" value="" id="Win_name" type="text">

</td>

But i just want to put

<input name="name" value="" id="Win_name" type="text">


The next question is why the struts cannot take the value of

<input name="username" value="" id="Win_username" type="text">

when I put this in the jsp file. In other words what is the difference
between <s:textfield name="username"/> and

<input name="username" id="Win_username" type="text">

(the Win is the jsp file name)

Thanks in advance

Re: [S2] Putting a single html input type="text"

Posted by Dariusz Wojtas <dw...@gmail.com>.
<s:textfield name="propName" theme="simple"/>

If you use theme 'ajax'  (eg. textfield nested within form with theme='ajax')
then it will generate a row with 2 cells, one with label, one with the
input field.
The bonus of 'ajax' is that it automatically generates validation
error mesage on the field level - if there were validation errors.
Look at the 'core' jar for templates. Different themes may generate
different output for tags.

Dariusz Wojtas

On 1/28/07, Omer Basar <om...@gmail.com> wrote:
> Thanks Dave.

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


Re: [S2] Putting a single html input type="text"

Posted by Omer Basar <om...@gmail.com>.
Thanks Dave.

Re: [S2] Putting a single html input type="text"

Posted by Dave Newton <ne...@yahoo.com>.
--- Omer Basar <om...@gmail.com> wrote:
> <s:textfield name="name"> generates the html [...]

<s:textfield name="name" theme="simple"/>

d.



 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 

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