You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Norman Klein <no...@first-franklin.com> on 2002/10/29 20:57:12 UTC

Can " format strings" be used with html:text input fields

Currently we use "format strings" to control the display output of our
financial fields for bean:write output statements.

	bean:write name="overviewForm" property="LHO_AppraisedPrice"
format="$###,###,###.00" />

This "format string" ensures that thousands and hundred thousands values
automatically have the appropriate number of commas inserted and that the
value ends with ".00". Is there a similiar clean way to do this with
"<html:text" fields. It won't recognize a "format" attribute and I would
prefer to keep all formatting in the JSP file and out of the corresponding
action.
ex.
	<html:text property="LHO_AppraisedPrice" />

Thanks, Norman

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Can " format strings" be used with html:text input fields

Posted by James Mitchell <jm...@telocity.com>.
Here's a quick work-around:

<input type="text" name="LHO_AppraisedPrice" value="<bean:write
name="overviewForm"
            property="LHO_AppraisedPrice"
            format="$###,###,###.00" />">


James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

"Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former."
- Albert Einstein (1879-1955)


> -----Original Message-----
> From: Norman Klein [mailto:norman.klein@first-franklin.com]
> Sent: Tuesday, October 29, 2002 2:57 PM
> To: 'struts-user@jakarta.apache.org'
> Subject: Can " format strings" be used with html:text input fields
>
>
>
> Currently we use "format strings" to control the display output of our
> financial fields for bean:write output statements.
>
> 	bean:write name="overviewForm" property="LHO_AppraisedPrice"
> format="$###,###,###.00" />
>
> This "format string" ensures that thousands and hundred thousands values
> automatically have the appropriate number of commas inserted and that the
> value ends with ".00". Is there a similiar clean way to do this with
> "<html:text" fields. It won't recognize a "format" attribute and I would
> prefer to keep all formatting in the JSP file and out of the corresponding
> action.
> ex.
> 	<html:text property="LHO_AppraisedPrice" />
>
> Thanks, Norman
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>