Skip to main content
Known Participant
July 6, 2017
Question

Force selection of drop down

  • July 6, 2017
  • 1 reply
  • 1007 views

Is there a way to force user to make a selection from a drop down before allowing them to move on to the next field?  Like it lights up red if selection not made?  I know in TurboTax, it won't let me do anything if I don't make a choice.  I want the field box to turn red and then an asterisk to come up telling user to make a selection.

I know how to do this by adding an app alert if the field is null but wanted to introduce a visual affect as well.

Thx.

Sue

This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
July 6, 2017

Trying to clarify...

If the user enters the dropdown field you want them to...

A) not be able to exit until they make a selection or

B) you want to allow them to exit but change the appearance of the dropdown field to indicate a value is required.

If A, you don't need B.

If B, you don't actually want A.

suemo22Author
Known Participant
July 7, 2017

Hi,

I guess A is the most simple so A.

I tried the following after the user clicks the okay button but nothing happens:

if ("ok" == cRtn)

{

      if (global.docNumAction.strExmp == null) //Ensure the document type is selected

      {

      app.alert (("Please select document type"))

      }

}

suemo22Author
Known Participant
July 7, 2017

I even tried adding .value but it seems it won't recognize a null value.  What am I doing wrong?  I want it to generate an app alert when there is no value in the strExmp field which starts of as "" and gets populated by drop down (if selected).  I want it notice thatno value was chosen from the drop down list and to alert the user.

   

if ("ok" == cRtn)

{

      if (global.docNumAction.strExmp.value == null) //Ensure the document type is selected

      {

      app.alert (("Please select document type. This field cannot be blank"))

      }

}