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 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2005
    Location
    United States
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Triple combo box, 3rd selection to open in a new window?

    I found this sample script and modified it to meet my needs, but I have not figured out how to get it to open the final selections/links to open in a new window. Currently they are opening on the same page. If this is confusing, I apologize. If you go to www.alabamahyundaidealer.com and click on "inventory" you will find the combo box there and then when you make the 3rd selection you will see what I mean. For convenience I have included the script. Thank you for your time and help!


    Code:
    <FORM name=isc>
    <TABLE cellSpacing=0 cellPadding=0 border=0>
    <TBODY>
    <TR align=middle>
    <TD noWrap height=11>&nbsp; <SELECT onchange=redirect(this.options.selectedIndex) size=1 name=example> <OPTION selected>---Select1-------------</OPTION> <OPTION>2005</OPTION> <OPTION>2006</OPTION></SELECT> <SELECT onchange=redirect1(this.options.selectedIndex) size=1 name=stage2> <OPTION value=" "></OPTION> <OPTION value=" ">---Select2--------------</OPTION> <OPTION value=" " selected>---Select2--------------</OPTION></SELECT> <SELECT onchange=redirect2(this.options.selectedIndex) size=1 name=stage3> <OPTION value=" "></OPTION> <OPTION value=" ">---Select3----------------</OPTION> <OPTION value=" " selected>---Select3----------------</OPTION></SELECT>
    <SCRIPT>
    <!--
    /*
    Triple Combo Script Credit
    By Hamid Cheheltani/ JavaScript Kit (http://www.javascriptkit.com)
    Visit http://javascriptkit.com for this and over 400+ other scripts
    */
    var groups=document.isc.example.options.length
    var group=new Array(groups)
    for (i=0; i<groups; i++)
    group[i]=new Array()
    group[0][0]=new Option("---Select2---"," ");
    group[1][0]=new Option("Now Select This One"," ");
    group[1][1]=new Option("Hyundai Accent","47");
    group[1][2]=new Option("Hyundai Elantra","46");
    group[1][3]=new Option("Hyundai Sonata","45");
    group[1][4]=new Option("Hyundai XG350","44");
    group[1][5]=new Option("Hyundai Tiburon","43");
    group[1][6]=new Option("Hyundai Tucson","42");
    group[1][7]=new Option("Hyundai Santa Fe","41");
    
    group[2][0]=new Option("Now Select This One"," ");
    group[2][1]=new Option("Hyundai Accent","115");
    group[2][2]=new Option("Hyundai Elantra","116"); 
    group[2][3]=new Option("Hyundai Sonata","117");
    group[2][4]=new Option("Hyundai Azera","118");
    group[2][5]=new Option("Hyundai Tiburon","119");
    group[2][6]=new Option("Hyundai Tucson","120");
    group[2][7]=new Option("Hyundai Santa Fe","121");  
    var temp=document.isc.stage2
    
    function redirect(x){
    for (m=temp.options.length-1;m>0;m--)
    temp.options[m]=null
    for (i=0;i<group[x].length;i++){
    temp.options[i]=new Option(group[x][i].text,group[x][i].value)
    }
    temp.options[0].selected=true
    redirect1(0)
    }
    
    var secondGroups=document.isc.stage2.options.length
    var secondGroup=new Array(groups)
    for (i=0; i<groups; i++)  {
    secondGroup[i]=new Array(group[i].length)
    for (j=0; j<group[i].length; j++)  {
    secondGroup[i][j]=new Array()  }}
    secondGroup[0][0][0]=new Option("---Select 3---"," ");
    secondGroup[1][0][0]=new Option("---Select 3---"," ");
    secondGroup[1][1][0]=new Option("Now Select This One"," ");
    
    secondGroup[1][1][1]=new Option("GLS 3-Door","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][1][2]=new Option("GLS 4-Door","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][1][3]=new Option("GT 3-Door","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][2][0]=new Option("Now Select This One"," "); secondGroup[1][2][1]=new Option("GLS","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][2][2]=new Option("Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][2][3]=new Option("GT","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][3][0]=new Option("Now Select This One"," "); secondGroup[1][3][1]=new Option("GL","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][3][2]=new Option("GLS 4-Cyl","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][3][3]=new Option("GLS V6","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][3][4]=new Option("LX","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][4][0]=new Option("Now Select This One"," "); secondGroup[1][4][1]=new Option("XG350","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][4][2]=new Option("XG350L","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][5][0]=new Option("Now Select This One"," "); secondGroup[1][5][1]=new Option("GS","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][5][2]=new Option("GT","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][5][3]=new Option("GT Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][5][4]=new Option("SE","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][6][0]=new Option("Now Select This One"," "); secondGroup[1][6][1]=new Option("GL","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][6][2]=new Option("GLS","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][6][3]=new Option("Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][7][0]=new Option("Now Select This One"," "); secondGroup[1][7][1]=new Option("GLS 2.7","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][7][2]=new Option("GLS 3.5","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[1][7][3]=new Option("Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][0][0]=new Option("---Select 3---"," "); secondGroup[2][1][0]=new Option("Now Select This One"," "); secondGroup[2][1][1]=new Option("GLS 3-Door","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][1][2]=new Option("GLS 4-Door","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][1][3]=new Option("GT 3-Door","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][2][0]=new Option("Now Select This One"," "); secondGroup[2][2][1]=new Option("GLS","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][2][2]=new Option("Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][2][3]=new Option("GT","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][3][0]=new Option("Now Select This One"," "); secondGroup[2][3][1]=new Option("GL","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][3][2]=new Option("GLS 4-Cyl","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][3][3]=new Option("GLS V6","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][3][4]=new Option("LX","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][4][0]=new Option("Now Select This One"," "); secondGroup[2][4][1]=new Option("Azera","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][4][2]=new Option("AzeraL","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][5][0]=new Option("Now Select This One"," "); secondGroup[2][5][1]=new Option("GS","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][5][2]=new Option("GT","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][5][3]=new Option("GT Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][5][4]=new Option("SE","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][6][0]=new Option("Now Select This One"," "); secondGroup[2][6][1]=new Option("GL","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][6][2]=new Option("GLS","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][6][3]=new Option("Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][7][0]=new Option("Now Select This One"," "); secondGroup[2][7][1]=new Option("GLS 2.7","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][7][2]=new Option("GLS 3.5","http://www.alabamahyundaidealer.com/pages/5/index.htm"); secondGroup[2][7][3]=new Option("Limited","http://www.alabamahyundaidealer.com/pages/5/index.htm");
    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 } //--> </SCRIPT> </TD></TR></TBODY></TABLE></FORM> <P><FONT face=arial size=-2>This free script provided by</FONT><BR><FONT face="arial, helvetica" size=-2><A href="http://javascriptkit.com/">JavaScript Kit</A></FONT></P>

    I am asking about the 3rd selection in the "second group" part of the code, where the final vehicles are associated with the link "www.alabamahyundaidealer.com/............". I would like that link to open in a new window. I have wraped them with the "quote tags".
    Last edited by jwass52; 12-07-2005 at 05:24 PM. Reason: Clarification

  • #2
    New Coder
    Join Date
    Dec 2005
    Location
    United States
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I stumbled across this

    <a href="window.open(...);return false;">

    would this be any helpful for me? If so, where exactly would I want to incorporate it?

  • #3
    New Coder
    Join Date
    Dec 2005
    Location
    United States
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello, me again!

    I found this : <a href="newpage.html" onclick="window.open(this.html); return false;">new page</a>

    and have had no luck.

    I have been looking for a solution, and yes I have STW. I am signed up for online training through New Horizons, but have not been able to locate a solution.

    Any help would be appreciated, and if you might know of some great training material, please let me know.

    Thank You for anything at all.

  • #4
    Regular Coder 2reikis's Avatar
    Join Date
    Nov 2005
    Location
    New Mexico, USA
    Posts
    174
    Thanks
    18
    Thanked 13 Times in 13 Posts

    new window code

    You might play around with window.open instead of location.href. Here is a good tutorial. http://www.pageresource.com/jscript/jwinopen.htm

    Something like:

    Code:
    function redirect2(z){
    window.open(temp1[z].value,"popWin")
    window.close()
    }
    This would open the url in a new window and then close the current window. The window.close() line is optional.

  • #5
    New Coder
    Join Date
    Dec 2005
    Location
    United States
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your help reikis! It worked like a charm and thank you for the link to the walk-through, very helpful! As they would say on ebay A+++++++++++

  • #6
    Regular Coder 2reikis's Avatar
    Join Date
    Nov 2005
    Location
    New Mexico, USA
    Posts
    174
    Thanks
    18
    Thanked 13 Times in 13 Posts

    good on you!

    I had a feeling. Glad that helped.

  • #7
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macintosh request

    Hello I want to open the popup after click on submit button

    So please help me out

    Thanks and Regards
    Manish Kumar
    abmanish71@gmail.com


    Quote Originally Posted by 2reikis View Post
    You might play around with window.open instead of location.href. Here is a good tutorial. http://www.pageresource.com/jscript/jwinopen.htm

    Something like:

    Code:
    function redirect2(z){
    window.open(temp1[z].value,"popWin")
    window.close()
    }
    This would open the url in a new window and then close the current window. The window.close() line is optional.


  •  

    Posting Permissions

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