Skip navigation
Currently Being Moderated

How to validate a drop-down list before move on?

Mar 15, 2012 6:11 AM

Hello,

 

I want to force the user to select a value in the drop-down list before she can move on the the next  field.  for instances, I have a drop-down list A, whose default value is empty.  as the user clicks on the next field, I need to throw a warning that she needs to select the value for drop-down list A.

 

Thank you for your help.

 
Replies
  • Currently Being Moderated
    Mar 15, 2012 6:35 PM   in reply to aenigmabella

    On the exit event of the drop-down list, you can do a test

     

    if ( this.isNull )
    {
        xfa.host.messageBox("Select item from list");
    }
    

     

    You can place any other custom changes to the field inside the if statement to show the error.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 19, 2012 10:14 AM   in reply to aenigmabella

    Yeah it would be the same idea basically. But you just need to decide where to have the event (on enter/ on exit of which field) and then use the same code where you can as many conditions as you like. For example,

     

    if ( field1.isNull && dropdown1.isNull )

    {

    ...

    }

     

    and so on.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points