Helpful Information
 
 
Category: Visual Basic Programming
VBScript for webforms

I am using VBScript to modify the values of fields in my web form based on values entered in other fields....

Its a 'change user info' type form, where the administrator of my program selects a user name from a dropdown list and information relating to that user is loaded, including 'supervisor'...I want to enter the existing information about the user into the form, such that they can see the existing values and change those that are no longer relevant

I've managed to do this for all fields except my dropdown list that I can't manage to change the option selected.

My theory is to step through the options of the list until I find the option that has a value=myVal, and then I'll set the SelectedIndex to the index of this option....I need help on the syntax to get the options value, i'm using:

Set changeForm = document.forms("Modify_User")
...
Dim x=0
do while (changeForm.supervisor.Options[x].Value<>myVal)
x=x+1
loop

I've also tried:

Set changeForm = document.forms("Modify_User")
...
Dim x=0
do while not (changeForm.supervisor.Options[x].Value=myVal)
x=x+1
loop

Neither work. Help please?

Does the answer that 'Onslaught' gave for the post 'Debugging my VBScript for ages & still won't work - whats wrong with it???'
apply to you?










privacy (GDPR)