Getting attached text from value in WebRadioGroup
For a test that I'm working on, webradiogroups use dynamic values and the attached text for each selection does not usually match the submitted value (select 'Males only' option and the 'submit' button passes 'M', etc).
I've gotten all of the values from the radiogroup based on the code presented in another thread... but aside from running a for/next loop to determine the attached text (based on the 'selected item index' value), I can't seem to figure out a faster way to directly determine the attached text for the selected value. I'm hoping that someone has an idea that will make my code run a little faster.
What I'm looking for is a way to directly determine the attached text of the selection so that I can build a reusable function to pass a text string to the function and check that the text passed is the selected value.
Any assistance would be greatly appreciated.
Re: Getting attached text from value in WebRadioGroup
Use dictionary to make text and value a pair:
Set d = CreateObject("Scripting.Dictionary")
d.Add "M", "Males only" ' Add some keys and items.
or use 2 arrays
arrText ("M", "F", "B")
arrValue ("Males only", "Females only", "Both")