1 Reply Latest reply on Sep 23, 2008 6:38 AM by Newsgroup_User

    Clear all form fields using form's id?

    EvolvedDSM Level 2
      In the past, I've always set a function to the reset button of a form to clear all the fields within it. In the function I individually clear each field though, which seems redundant if I want to simply clear the whole form.
      I've been doing this...
      input1.text = '';
      input2.text = '';
      input3.text = '';
      and so on...

      What I'd like is...
      form1.allFields.clear()
      something along those lines. So I can just clear all the fields of a form instead of doing what I exampled above. Is there a way to do this?
        • 1. Re: Clear all form fields using form's id?
          Level 7

          "EvolvedDSM" <webforumsuser@macromedia.com> wrote in message
          news:gbaqp0$amb$1@forums.macromedia.com...
          > In the past, I've always set a function to the reset button of a form to
          > clear
          > all the fields within it. In the function I individually clear each field
          > though, which seems redundant if I want to simply clear the whole form.
          > I've been doing this...
          > input1.text = '';
          > input2.text = '';
          > input3.text = '';
          > and so on...
          >
          > What I'd like is...
          > form1.allFields.clear()
          > something along those lines. So I can just clear all the fields of a form
          > instead of doing what I exampled above. Is there a way to do this?

          AdvancedForm may do what you want:
          http://code.google.com/p/flexlib/wiki/ComponentList