• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Clear and Reset Functionality in struts

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 Reddy
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic