Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Updating actions based on checkbox selection

Avatar

Level 3

Hi,

  • In the order of filling out my form, the user must first choose between A or B in a dropdown box; the value is required and the default is no value specified.
  • Afterwards, if and when the user selects a checkbox (on of four boxes) my script determines whether A or B is selected. Based on this determination, the form displays Text-A or Text-B.
  • This works fine...unless the user changes the selection in DDbox after selecting the checkbox! The form displays the old text--unless the checkbox is unchecked and rechecked.

What can I do to update the checkbox (and the appropriate action) if the DDbox is changed?

What can I do to warn the user if they try to check the box before making a dropdown selection?

Any ideas are welcome.

5 Replies

Avatar

Level 8

In the change event of your drop down you can put:

CheckBox.rawValue="";//The name of your checkbox
TextA.presence="hidden";//The name of your text objects
TextB.presence="hidden";

Kyle

Avatar

Level 3

Thanks Kyle,

This idea at least resets the check-box and forces the user to reselect...for now I will use this method until anything else comes to mind.

Thanks again,

Nadeem

Avatar

Level 9

Hi Nadeem,

How about writing some script in the change event of the DropDown which will examine first if a particular check box is checked or not and depending upon the Checkbox selection it will show/hide the Text.

In the change event of the dropdown you can write

if !(xfa.event.change = "DefaultValue") Checks whether default value is selected or not

     {

          if (CheckBoxA.rawValue == 1) // Similarly you can check the value of other check boxes

              {

                    TextA.presence = "visible";

               }

          else

               {

                    TextA.presence = "hidden";

               }

     }

else

     {

     // some code as you wish

     }

Thanks,

Bibhu.

Avatar

Level 3

Thanks for your suggestion Bibhu,

The intent is to have the user make a choice in the dropdown first before filling out the rest of the form since the checkbox in question displays alternate information based on the choice in the dropdown--other settings and entries are not affected. Revision feedback recieved since I started the form requests that I provide some guidance to the user in helping them make the correct choice. So I have redesigned the way the dropdown works, as follows.

In the click event of the dropdown I present the user with a dialog box that asks a series of questions. Based on the "yes" "no" answers I get, I then set the value of the dropdown. Alternately, the user has the option of not answering the questions and choosing the value manually.

The problem arises in the unlikely (but possible event) that the user goes back to the dropdown and changes their mind about the choice. In that event, I prefer the scenario of making their subsequent settings (related to the check box in question) null and void. I may wind up using your useful suggestion as the form evolves. Thanks again for your help.

Avatar

Level 9

In that case you need to validate the checkbox selections in the change event of the dropdown. What you need to do is if the user after selecting the checkbox wishes to change his mind and reselect something in dropdown you need to clear the checkboxes.

Thanks,

Bibhu.