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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Location
    Guildford, UK
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multi combo boxes doing something weird...

    can anyone tell me why after i select the option from my third combo box it automatically takes me to a file and folders tasks window? i want it to move to a text box really but i havent added that in yet...

    var temp1=document.isc.stage3
    function redirect1(y){
    for (m=temp1.options.length-1;m>0;m--)
    temp1.options[m]=null
    for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
    temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
    }
    temp1.options[0].selected=true
    }

    function redirect2(z){
    window.location=temp1[z].value
    }


    hopefully its in that bit somewhere, but im not 100% sure

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Code:
    var temp1=document.isc.stage3
    function redirect1(y){
    for (m=temp1.options.length-1;m>0;m--)
    temp1.options[m]=null
    for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
    temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
    }
    temp1.options[0].selected=true
    }
    
    function redirect2(z){
    //window.location=temp1[z].value
    alert(temp1[z].value)
    }
    the top line in bold has been commented out (the //), the bottom line simply uses whatever the final value is and alerts it. Should you wish to input this into a form element, you could change that second bold line to:
    Code:
    document.yourFormName.yourElementName.value = temp1[z].value;
    hope this helps
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #3
    Regular Coder
    Join Date
    Jul 2005
    Location
    Guildford, UK
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    cheers, thats what im after.

    however, i know the form name, but, here is my nooby bit, whats the elementName. ideally, after selecting the final option i want the focus to go to a text box so i can start typing without using the mouse to click on the box....

    thanks dude

    EDIT: PS love the sig :P

  • #4
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    well that part's up to you mate - you can create your own form such as this:
    Code:
    <form name="myForm" method="post">
    <input type="text" name="myTextInput" size="40">
    </form>
    and then in the code change the relevant line to:

    Code:
    document.myForm.myTextInput.value = temp1[z].value;
    document.myForm.myTextInput.focus();
    Hope this helps

    Tommy Cooper's wicked - I still love Spike Milligans gravestone tho - it just says "I told you I was ill"

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #5
    Regular Coder
    Join Date
    Jul 2005
    Location
    Guildford, UK
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    spot on! cheers...

    PS my headstone is going to say

    James Hunt - Buried Alive

  • #6
    Regular Coder
    Join Date
    Jul 2005
    Location
    Guildford, UK
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts
    next logical step...

    so i select the data from the combo boxes, then type in any extra data. i now want to press submit and save the data from these boxes and text box onto a new page as a link, so that i can click on it and it will bring up the information.

    all of this is so far above my head its making feel dizzy! but im getting there with a little help

    thanks in advance


  •  

    Posting Permissions

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