Thursday, May 03, 2012 8:54 AM
I have a drop down list box with the pair value - display name.
When the user select an entry from the drop down the value is copied into a textbox (i'm using the Action "set a field value" for doing this)
...but I need also the Display Name to copied into another textbox...how can I do this?
Thursday, May 03, 2012 12:23 PM
The list box choices for the dropdown list has to come from somewhere else, it can't be the choice: "enter manually".
So, either from somewhere else in the form (you can create a hidden repeating area that's not shown on the form, and enter different default value rows to populate it), or from a secondary data source (list, or even just an external XML file).
Assuming now you have a secondary data source from this XML.
Your first rule for setting the value is fine. The rule would be something like:
set /my:myFields/my:value1 to /my:myFields/my:dropdown1
To get the display value, you need to grab it from the list, but filter it using the currently selected value.
set /my:myFields/my:display1 to xdXDocument:GetDOM("Names")/names/name/display[../value = current()]
you can also use:
set /my:myFields/my:display1 to xdXDocument:GetDOM("Names")/names/name/display[../value = xdXDocument:get-DOM()/my:myFields/my:dropdown1]
current() will only work if the rule is run on the dropdown itself. Current refers to the immediate bound field.
if you are using lists or some other schema for your dropdown list, you'll need to change your XPath accordingly.
jliu - http://johnliu.net - http://sharepointgurus.net
Thursday, May 03, 2012 6:38 PM
Thank you very much!!!!!