469,322 Members | 1,606 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

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 1339
acoder
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.