Hey all. I am trying to make a website and I have this kinda code in it. <TD WIDTH=252 HEIGHT=167 COLSPAN=12 ROWSPAN=3 align="center" valign="middle" background="images/spacer.gif" bgcolor="#E0E0E0"> <select name="select" size="8" style="width:200"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> </select></TD> Now If someone came to my site and selected lets say <option>1</option> which would only show as 1 duh but if they selected that and they double clicked that selection... How could I make <option>1</option> link to lets say index-2.html... Please help me.. If you help me and its what I need ill give you 35 credits... Thanks all - Brian
Me and my 2 friends tried to get a general script which would do what you are looking for. If you need any changes or dont understand the code. Then feel free to ask any questions. Code: <html> <head> <title>JavaScript Jump Menu</title> <script language="JavaScript"> function JumpTo( form ) { var link = form.target.selectedIndex; if ( link > 0 ) { url = form.target.options[ link ].value; window.location.assign( url ); } } </script> </head> <body> <form name="jumpbox"> <select id="target" size="1" onChange="JumpTo( this.form )"> <option>Jump To </option> <option value=http://logicrises.co.uk>Logic Rises</option> <option value=http://google.co.uk>Google</option> </select> </form> </body> </html> Regards Rees
nice script and its works but you can do it with far less code the only line you need to add is the following and you add that to the <select> tag Code: onChange="if(this.value!='')window.location=this.value;" Code: <html> <head> <title>Shortest JavaScript Jump Menu</title> </head> <body> <form> <select size="8" onChange="if(this.value!='')window.location=this.value;"> <option >Jump To </option> <option value=http://logicrises.co.uk>Logic Rises</option> <option value=http://google.co.uk>Google</option> <option value=http://www.gamerenders.com>GameRenders</option> </select> </form> </body> </html>