|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Javascript help wanted
Hello , I have very little javascript knowlege could somebody assist me in converting the following code so that only one of the selected changes to a link and the rest remain as variables.
Thank you. <!--scripts from A1 Javascripts http://www.a1javascripts.com/ --> <FORM NAME="Menu"> <SELECT name="URL" onChange="if(options[selectedIndex].value) window.location.href= (options[selectedIndex].value)"> <Option Value="page1">Page 1 <Option Value="page2">Page 2 <Option Value="page3.html">Page 3 <Option Value="page4.html">Page 4 <Option Value="page5.html">Page 5 <Option Value="page6.html">Page 6 <Option Value="page7.html">Page 7 <Option Value="page8.html">Page 8 <Option Value="page9.html">Page 9 <Option Value="page10.html">Page 10 <CENTER> </SELECT> |
|
#2
|
|||
|
|||
|
RE: Javascript help wanted
I dont think I understand your question. If you put the following code into your HTML document, and the pages (page1.html etc.) exist, this code works perfectly:
<html> <head> <title>start page</title> </head> <body> <p> select one of the pages below! </p> <FORM NAME="Menu"> <SELECT name="URL" onChange="if(options[selectedIndex].value) {window.location.href=(options[selectedIndex].value)}"> <Option Value="">Select One <Option Value="page1.html">Page 1 <Option Value="page2.html">Page 2 <Option Value="page3.html">Page 3 <Option Value="page4.html">Page 4 <Option Value="page5.html">Page 5 </SELECT> </FORM> </body> </html> This code causes the user to be redirected to the selected page as soon as it is selected. Do you want a seperate link to appear below the SELECT object, containing the page that is selected? (exmaple: a 'Go' button, or text link) |
|
#3
|
|||
|
|||
|
RE: Javascript help wanted
Sorry I wasn't clear, what I am looking for is to have 10 choices, and only one of them will automatically select and go to a link, the rest will just remain as static variables, what I am looking to do is create 2 extra input cells on the form when the certain one is selected.
I have little knowledge of javascript, so when the select one it would "onclick:thiscode.php" and the code would execute an extra field. |
|
#5
|
|||
|
|||
|
RE: Javascript help wanted
<select name=example>
<option name=choice1>1 //static choice <option name=choice2>2 //static choice <option name=choice4>3 //static choice <option name=choice5 onclick="javascript:executeMyPhpscript.php">5 //dynamic selection </select> //php script include ("originalForm"); echo "<input type=text name=additionalInput><input type=text name=additionalInput2>"; |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Javascript help wanted |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|