7 Replies Latest reply on May 9, 2011 8:36 PM by sohilr

    Clean errorString

    jfb00 Level 3

      Hi All,

      I have a function validator and every time I press a submit buttom I call this function. If I press the submit button twice it display the error twice and it will continue adding the error string if I keep pressing the submit button.

      I try using errorString = "" but it is not working.

      Any ideas how to clean the error?


      var dataField:String = fieldName.name;
      var nv:NumberValidator = new  NumberValidator;
      fieldName.errorString = "";
      nv.source = fieldName;
      nv.property = "selectedIndex";
      nv.requiredFieldError = "This field is required";
      nv.lowerThanMinError = "This field is required";
      nv.minValue = 1;
      var val:* = nv.validate();
      return false;