471,881 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

How to clear the text fields ofter submit.

I have a simple struts applications. when I submit the form it inserts into the table and go back to the input screen. I want the html fields to be cleared. They still contain the values that i entered.

how to clear this values.i have to write like this in my formbean.

Expand|Select|Wrap|Line Numbers
  1. public void reset(ActionMapping mapping, HttpServletRequest request) {
  2. this.dscpt = null;
  3. this.brokercd = null;
  4. this.lname = null;
  5. this.icno = null;
  6. this.conttitle = null;
  7. this.contname = null;
  8. this.department = null;
  9. this.addr1 = null;
  10. this.addr2 = null;
  11. this.addr3 = null;
  12. this.addr4 = null;
Sep 17 '07 #1
1 1375
16,027 Expert Mod 8TB
Define a Javascript function which clears the form values and call it on page load.
Sep 17 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Dave B | last post: by
1 post views Thread by johnacooke | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.