Skip navigation
Currently Being Moderated

Null Text Field, how to prompt to fill in another text field

May 30, 2012 1:38 AM

I would like to be able to prompt the user to fill in either one of two text fields, If for example they fill in text field A, then no prompt would pop up, but if they didn't fill in text field A then a prompt would pop up asking them to fill in text field B.

 

Thanks

 
Replies
  • Currently Being Moderated
    May 30, 2012 7:21 AM   in reply to sp215

    Hi,

     

    One way would be to place a JavaScript in the exit event of TextFieldA:

     

    if (this.rawValue === null) {
         xfa.host.messageBox("Please complete Text Field B", "Attention", 0, 0); 
    }
    

     

    However this will only fire when the user exits TextFieldA. You may need additional script if it is likely that the user does not even enter this text field.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    May 30, 2012 7:27 AM   in reply to sp215

    Hi,

     

    Yes, you would use the same script in the same object, but you would just need to decide when this would be fired.

     

    For example, you might add the script to the prePrint event or the preSubmit event and see does this match the functionality you are looking for.

     

    Does that help?

     

    Niall

     
    |
    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