2 Replies Latest reply on Apr 1, 2011 10:10 AM by jfb00

    Validate Alert yes|no

    jfb00 Level 3

      Hi All,

      I have a function to validate my form. I am trying to add an Alert box inside this validation to capture user choice to continue or stop.

      How can I pass the result of my alert box to my return variable of my function and stop the validation?

      Here is my code:

      private function validationForm():Boolean{
          var alertValue:Boolean = false;
          if(Number(first_total.text) < 100 || Number(second_total.text) < 100){
              Alert.show("Totals should be 100, do you want to apply changes","Error",Alert.YES|Alert.NO, null,
                              if (evt.detail == Alert.YES)
                                  alertValue =  true;
                                  alertValue =  false;
               return alertValue; //Is always false, of course is not capturing the choice from my alert box
          return true;


      Of course I have validation when is more than 100 and other validations from my form, this is part of my code.

      Please help.