You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by lixin chu <li...@yahoo.com> on 2004/08/21 07:06:43 UTC

> does not clear all on the page ?

Hi,
A new problem:
I have a Clear button which suppose to clear the input
fields. However, when I use bean:write to display the
current value on the page, and disable reset() in the
ActionForm, after pressing Clear button, the value in
Form (session scope) is still displayed on the page.

is it expected ? I thought Clear does clear whatever
on the page (form) and values in the ActionForm are
not touched.

thanks !
li xin

JSP code below:
------------------------------------------------
<html:form action="/admin/OrgAction">
<table>
 <th Basic Information</th>   
   <tr>
   <td>Name*:</td>
   <td><input type=text name=name size=20
value='<bean:write name="createOrgForm"
property="name"/>'/></td>
   </tr>
   
   <tr>
   <td>Description :td>
   <td><input type=text name=description size=20
value='<bean:write name="createOrgForm"
property="description"/>'/></td>
   </tr>
   
   <tr>
   <td></td>
   <td align=left><html:submit><bean:message
key="button.update"/></html:submit></td>
   <td align=right><html:reset><bean:message
key="button.clear"/></html:reset></td>
   </tr>

</table>


		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

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


Asunto: > does not clear all on the page ?

Posted by Guillermo Meyer <gm...@fibertel.com.ar>.
The html:reset button restores the input values to the values that are specified
in the value property.

For example, if you have the following inputs in an html page:

<input type="text" name="abc1" value="Hello"/>
<input type="text" name="abc2" value=""/>

<input type="reset"/>

the user can change the values of the inputs typing new values in the browser,
and if he press the reset button, what will happen is that abc1 will get
"Hello" value and abc2 will be "". Reset doesn't clear the fields but restores
to the original values that are specified in the value attribute of the
input tag.

Using html:text will produce the value attribute tith the corresponding
value of the property asocited to the html:text tag.

Cheers.
Guillermo.


>-- Mensaje original --
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>Date:	Fri, 20 Aug 2004 22:06:43 -0700 (PDT)
>From:	lixin chu <li...@yahoo.com>
>Subject: ><html:reset> does not clear all on the page ?
>To:	"struts-user@jakarta.apache.org" <st...@jakarta.apache.org>
>
>
>Hi,
>A new problem:
>I have a Clear button which suppose to clear the input
>fields. However, when I use bean:write to display the
>current value on the page, and disable reset() in the
>ActionForm, after pressing Clear button, the value in
>Form (session scope) is still displayed on the page.
>
>is it expected ? I thought Clear does clear whatever
>on the page (form) and values in the ActionForm are
>not touched.
>
>thanks !
>li xin
>
>JSP code below:
>------------------------------------------------
><html:form action="/admin/OrgAction">
><table>
> <th Basic Information</th>   
>   <tr>
>   <td>Name*:</td>
>   <td><input type=text name=name size=20
>value='<bean:write name="createOrgForm"
>property="name"/>'/></td>
>   </tr>
>   
>   <tr>
>   <td>Description :td>
>   <td><input type=text name=description size=20
>value='<bean:write name="createOrgForm"
>property="description"/>'/></td>
>   </tr>
>   
>   <tr>
>   <td></td>
>   <td align=left><html:submit><bean:message
>key="button.update"/></html:submit></td>
>   <td align=right><html:reset><bean:message
>key="button.clear"/></html:reset></td>
>   </tr>
>
></table>
>
>
>		
>_______________________________
>Do you Yahoo!?
>Win 1 of 4,000 free domain names from Yahoo! Enter now.
>http://promotions.yahoo.com/goldrush
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>


________________________________________
FiberTel, el nombre de la banda ancha http://www.fibertel.com.ar



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