#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    Australia
    Posts
    20
    Rep Power
    0

    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?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    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?
    El éxito consiste en una serie de pequeñas victorias día a día

    MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html

IMN logo majestic logo threadwatch logo seochat tools logo