Hi does anyone know if the ‘pass to next’ function, can be used with checkboxes or dropdowns?
I have looked through the different interaction options and am wondering if I am missing something.
Thanks in advance
Hi does anyone know if the ‘pass to next’ function, can be used with checkboxes or dropdowns?
I have looked through the different interaction options and am wondering if I am missing something.
Thanks in advance
What do you mean by “pass to next”? Are you referring to this tutorial?
If so, yes you can pass the text value, selection state or selected option of any widget to another page using global variables. Just pick an appropriate option in the SET TO droplist within the Set Variable Value action.
Depending on what you want to “pass” to another page from a checkbox, you could set global variables to any or all of:
If you are using the Droplist widget for your dropdown, use:
If you want to set the property of a global variable upon selection change, you can use the Selected event of a checkbox, or “Selection Changed” event of a droplist, and use this more generic action code: “Set Variable Value OnLoadVariable to is selected of This” or “…selected option of This”. Likewise, “…[[This.name]]” or “…[[This.top]]” That makes it easier to cut& paste to other widgets/pages.
Hi, thanks for your reply. @mbc66
I am fairly new to this so I am not fully understanding.
I would like to use Global variables and ‘pass’ the users selection on to another page.
I have uploaded a file which I have removed everything else from so it just has the fields, if you would be willing to take a look, I would really appreciate your help.
Thanks dropdown-and-boxes.rp (144.6 KB)
Here is the basic process involved in passing data from one page to another. (Step “zero” would be creating global variables from Project > Global Variables and widgets on the pages of course.)
So, on your Page 1 you’ve got a droplist widget named “Marital”, an identical one on Page 2 and you’ve created a global variable named Martial_status --all great (other than typo in global variable name but it will still work ). I added an Interaction Event, Selection Changed to the droplist on Page 1 :
Set Variable Value Martial_status to selected option of This
Now whenever the user changes the selected item in this droplist, it will be tracked in that global variable.
Likewise, you’ve got three custom-designed checkboxes implemented as dynamic panels. (Not sure what the “ACTIVATED” state is all about, but I assume it serves some purpose.) You already have code to change the state to Next (and wrap) when user clicks a checkbox–great. I added three more global variables to track the state of each checkbox. I added an Interaction Event to each checkbox, State Changed, for example the “Phone” checkbox:
Set Variable Value Contact_Phone to state of This
That takes care of “Step 1” above. I added a Click or Tap event to your “Save and continue” button to load Page 2. Then, on Page 2 I notice you already had a Loaded event for the droplist to:
Set Variable Value Martial_status to value of Martial_status
I can tell what you were trying to do here, but this action merely sets the value of the global variable named Martial_status to the value of the global variable named Martial_status --which would not actually result in any change because it is setting the value to itself. Make sense? I changed this to:
Set Selected List Option of This to value of Martial_status
Likeswise, I added Loaded events for each checkbox to set the state of their dynamic panel, for example, the “Phone” checkbox:
Set Panel State of This to [[Contact_Phone]]
–Here, the name of the global variable is “Contact_Phone” and its value is accessed by wrapping it with double-square brackets. That is the syntax Axure uses to refer to variables and evaluate mathematical expressions. You can either type this into a “value” field of an event in the INTERACTIONS pane, or click the little “fx” icon at the right of these input fields to display the “Edit Value” dialog and then the “insert Variable or Function…” link, and look under “Global Variables” as described in my previous post above. You can learn more about using variables and math in Axure here:
So that’s it. When user makes a choice on Page 1 is is tracked in a global variable, and when Page 2 loads, it uses the value of those global variables to display those choices.
dropdown-and-boxes.rp (146.6 KB)