File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Clear and Reset Functionality in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Clear and Reset Functionality in struts" Watch "Clear and Reset Functionality in struts" New topic
Author

Clear and Reset Functionality in struts

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
How to implement Clear and Reset Functionality in struts?

Note: Iam using struts 1.2.9

In both the cases iam using reset button but with different functionality, but iam unable to get the expected result..

I have used reset tag for clearing the struts form fields, it works for the first time.......but the problem is iam doing validations on the server side, so if validation fails same form will be displayed with populated html data and errors.....now if i click on reset button nothing will happen.

need help regarding........

Note:
Clear: All struts html fields data has to be cleared (Using while adding data)
Reset: By default struts html fields will be populated with the data, after doing some modification if user clicks on reset button, the same default data has to be displayed in the fields. (Using while editing data)

Abhishek
Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
I have handled the clear functionality on the client side using javascript.....

how i should handle the reset functionality, when validation fails form will be set the current data and reset operation fails?
 
 
subject: Clear and Reset Functionality in struts
 
Similar Threads
clearing HTML form fields after return from struts validation with errors
calling reset on the form bean
clear dynavalidator form
Struts Issue - Repopulating a Form Bean
Struts 1.1: html:radio issues