How to clear the text fields ofter submit.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • micross
    New Member
    • Sep 2007
    • 5

    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.

    [CODE=java]public void reset(ActionMap ping mapping, HttpServletRequ est request) {
    this.dscpt = null;
    this.brokercd = null;
    this.lname = null;
    this.icno = null;
    this.conttitle = null;
    this.contname = null;
    this.department = null;
    this.addr1 = null;
    this.addr2 = null;
    this.addr3 = null;
    this.addr4 = null;[/CODE]
    Last edited by acoder; Sep 17 '07, 09:03 AM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Define a Javascript function which clears the form values and call it on page load.

    Comment

    Working...