I'm using SP5.1, and here's my situation: I need to select randomly from a dynamically populated dropdown list. I've gotten the first value with WebParseDataBound, but I want all the values, and I don't know many that is (this changes every time). My question is "What is the best way to approach this?" The only solution is can see is to loop until I no longer find the text in the HTML tag that the WebParseDataBound looks for, recording a value each time. This tends to make the script run kinda slow, though - any faster way to do this? Then, when I get these values I need to select randomly from them, just in case that affects this at all. thanks.
I love deadlines. I like the whooshing sound they make as they fly by.
Place the following before the call to the URL: (the name of the listbox is PageTemplate_Status in the code):
I created a function called ListSelect to write each value into a blank webform (dclform LIST_FORM then randomly pick one of them. So, after the call to the URL, call the function passing it the string from the WebParseDataBound function.
Here is the function:
There are probably other ways of doing this, such as just counting the number of options in the string, and then doing a StrSearchDelimited on a randomly chosen number from that count. Hope this helps.