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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Posts
    131
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Post onChange reload to link

    Hello...

    I have this select input and onchange I want it to go to a specific link. Here's what I want it to do but not sure how

    Code:
    <SELECT Name="tape_type" VALUE="" onChange="window.location.href=tape.cgi?tape_type=$in{'$tape_type'}">
      <OPTION>--</OPTION>
      <OPTION VALUE='ADV'>ADV
      <OPTION VALUE='APP'>APP
      <OPTION VALUE='ATF'>ATF
      <OPTION VALUE='CEEB'>CEEB        
    </SELECT>
    It needs to go to the same page, but have the value stored in $tape_type added to the link. How do I assign the link??

    Thank you in advance
    ---------
    Client / Server Side Programmer II

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Something like:


    Code:
    window.location.href="tape.cgi?tape_type="+document.tape_type.options[document.tape_type.selectedIndex].value;
    You might have to put the form name in that as well. I didn't test it. Also the .value might be .text if doesn't work.

    david_kw

  • #3
    Regular Coder
    Join Date
    Sep 2006
    Posts
    131
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Thank you David, but i can't get it to work. Here is what i'm using and it still isn't working.

    Code:
    <FORM NAME="tape_type" METHOD="POST">
    <SELECT Name="tape_type" VALUE="" id="tape_type" 
    onChange="window.location.href="edfstatus_dev.cgi?amode=input&tape_type="+document.tape_type.options[document.tape_type.selectedIndex].text"">
    <OPTION>--</OPTION>
    <OPTION VALUE='ADV'>ADV
    <OPTION VALUE='APP'>APP
    <OPTION VALUE='ATF'>ATF
    <OPTION VALUE='CEEB'>CEEB        
    </SELECT>
    </FORM>
    ---------
    Client / Server Side Programmer II

  • #4
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oops sorry. I caused quote problems for ya.

    Try:

    Code:
    <FORM NAME="tape_type_form" METHOD="POST">
    <SELECT Name="tape_type" VALUE="" id="tape_type" 
    onChange="window.location.href='edfstatus_dev.cgi?amode=input&tape_type='+document.tape_type_form.tape_type.options[document.tape_type_form.tape_type.selectedIndex].text">
    <OPTION>--</OPTION>
    <OPTION VALUE='ADV'>ADV
    <OPTION VALUE='APP'>APP
    <OPTION VALUE='ATF'>ATF
    <OPTION VALUE='CEEB'>CEEB        
    </SELECT>
    </FORM>
    david_kw


  •  

    Posting Permissions

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