Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2004
    Location
    Milky Way Galaxy
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selectbox script error

    I keep getting errors with this script.

    Note: The name of the form is form, so that's right too.
    Here is the code for the select box:
    <select name="simselect" size="1">
    <option value="0001">0001</option>
    <option value="0002">0002</option>
    </select>

    Here is the script: (I narrowed it down to this spot)
    {
    if(document.form.simselect.options[document.form.simselect.selectedindex].value == "0001") {
    //I took this section out and still got the error
    }

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    if(document.form.simselect.options[document.form.simselect.selectedIndex].value == "0001") {
    The property is selectedIndex, not selectedindex.

    Hope that helps!

    Happy coding!

  • #3
    New to the CF scene
    Join Date
    Mar 2004
    Location
    Milky Way Galaxy
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •