how to clear the text fields values

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

    how to clear the text fields values

    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.

    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;
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by micross
    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.

    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;
    If you are allowed to use Javascript then I think you should use that to clear the fields.

    Comment

    Working...