Combo box link sample

Written by @kerixa 21 August 2012

When a user choose a link from the drop down combo box and clicks on the button, a pop up will appear and moves to the chosen link.

Code Snippet:

                                                
                                                <!-- this script is provided by www.javascriptfreecode.com coded by: Kerixa Inc. -->
<!-- This script opens a separate window for the locations you give it.
Pages are neat but pictures make a cool photo album. Change the 
attributes that read menubar=0,toolbar=0, etc... and Width & Height 
to meet your needs.  Make sure you place the URL's you want to go 
to and their names below.-->

<script language="JavaScript">
<!-- Hide the script from old browsers --
function surfto(form) 
{
  var myindex=form.dest.selectedIndex
  window.open(form.dest.options[myindex].value,"main","menubar=1,toolbar=0,location=0,directories=0,status=1,copyhistory=0,width=235,height=235");
}
//-->
</SCRIPT>
<CENTER>
<FORM NAME="myform">
  <SELECT NAME="dest" SIZE=1>
    <OPTION VALUE="http://www.coffeecup.com">CoffeeCup Software
    <OPTION VALUE="http://www.tmcm.com">Too Much Coffee Man
    <OPTION VALUE="http://www.netscape.com">Netscape
    <OPTION VALUE="http://www.javakhafan.7p.com">InfoSeek
  </SELECT>
<P>
<INPUT TYPE="BUTTON" VALUE="Go  !" onClick="surfto(this.form)">
</FORM>
</CENTER><a target='_blank' href='www.javascriptfreecode.com' style='font-size: 8pt; text-decoration: none'>JavaScript Best Codes</a>                                                
                                            

Example:


About @kerixa

I am Krishna Eydat. I studied Software Engineering at University of Waterloo in Canada. I lead a few tech companies. I am passionate about the way we are connected. I would like to be part of something big or be the big deal!

K

Comments


Here you can leave us commments. Let us know what you think about this code tutorial!

0 / 300

TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: Shahmeer, coolcoco7, SmitaPatil25, owoboycute, 092010
advertisement 2