struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Hickey" <bhic...@r-effects.com>
Subject Re: text input and style sheets
Date Fri, 30 Aug 2002 18:38:15 GMT
Mark,

Check the doc first, but I think you will find the following should work:


<html:text property="startDate" styleClass="input" type="text"
maxlength="10" cols="10"/>

this assumes you have a form bean with the get/set property named startDate
and containing a default value of "01/01/2000". If you don't want to access
the bean for a default, simply use the value= attribute to designate the
default.

Using a form bean has a benefit. You code the reset() and validate() methods
yourself. You control what the user sees on error.

Brian

----- Original Message -----
From: "Mark Silva" <msilva@authenex.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Friday, August 30, 2002 2:15 PM
Subject: text input and style sheets


Our HTML/design person has created our text input boxes with the following
code

<input name="startDate" class="input" type="text" maxlength="10" size="10"
value="01/01/2000">

I am trying to figure out a couple things...
1. How do I implement the class attribute within a stuts tag.  I am assuming
this is a CSS thing, since I haven't used it before.  anyone know?

2.  How do I set a default value for the input field?  if I said it
explicitly like so:

<input name="startDate" class="input" type="text" maxlength="10" size="10"
value="01/01/2000">

then the associated form does not repopulate the form field if there is an
error.  is the only way to do this, to make it an initial value in the form
object?


thanks,
mark silva

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




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


Mime
View raw message