This topic contains 5 replies, has 0 voices, and was last updated by Anonymous 8 years, 9 months ago.
- May 17, 2010 at 2:55 pm #496
is it possible to set the selected item in a drop-down? if so, how can we do that?
paulMay 17, 2010 at 3:35 pm #5260
Please explain in more detail what you mean ? You can define the ‘default’ selected item in the drop down as it is presented on the form from the drop down properties. When a user has selected an item from the drop down it is selected, and you can run a script to write/set this selection out to another field using the Set Field script (using either the value of the selected item or the caption)
Other than that though, not sure what you are trying to askMay 17, 2010 at 4:06 pm #5261
for instance, let’s say we have a drop-down with the following items:
is there a way to dynamically set the selected item(s)? if, for instance, the user is a reviewer and trying to look over a form someone had previously filled out, how can we set the previously selected item in the drop-down?
another example would be if the person had previously selected states from a u.s. state’s list input. if they went in to adjust their answers at a later time, how can we set those previously selected states again?
essentially, is there a way to access the “selected” property of drop-down and list objects programmatically so we can say “set item ‘cat’ as selected” or “set items ‘ohio’,’texas’, and ‘new york’ as selected”?
paulMay 17, 2010 at 4:27 pm #5262
Once the user has selected from the drop down, that selection is stored so unless you have another ‘action’ that is overwriting this field for a future stage what they selected will still be visible to users throughout future stages.
From what you are asking I think you may have this situation. Are you for instance populating this drop down from a connect action? If so, refer to this post
You can though use the ‘set field’ script to set the selection item in a drop down where you can set the drop down to a specific item by using the VALUE for that selection. ie if in your case here ‘cat’ has the value of 2 for its item, set up the set field to the required drop down and then enter 2 into the ‘text or number’ field in the value property in the set field script
if this still isn’t helping, perhaps will be clearer if you can set up an example form to show what you want to do and send over to us via the support ticketMay 17, 2010 at 7:57 pm #5263
great! that’s what we needed for the drop-downs. thanks for the responses.
out of curiosity, i see that we can also select items in the list object using the same “set field” action. is there a way to set multiple selections in the list object?
paulMay 18, 2010 at 8:16 am #5264
Afraid not, if you use separate ‘set field’ actions for each of the item values, the last set field will overwrite the previous ones
You must be logged in to reply to this topic.