tags:

views:

14

answers:

1

Hi friend, I have 1 jsp form whcih take user detail and after clicking on submit button its store the data into DB and success message is displaying on the top of the GUI but the problem is all the data iin the input boxes are not clear, data remain same in the input boxes i m using struts2 can any body tell me how to clear all input boxes

Thanks shakil

A: 

One option is to use a javascript to reset the form when the user clicks on submit. To do this, add the following javascript to your submit button (change 'form' to be the name of your form):

<s:submit value="Save" onclick="this.form.reset();" />

You could also use the Struts 2 JQuery Plugin which has a special tag for this purpose.

David-Zazeski