Can my dropdown menu produce a link instead of textbox?

 
0
 

Can my dropdown menu produce a link instead of textbox? Is it possible? If so, how?

<script type="text/javascript">
function fifa()
{
    var frm = document.forms[0];
    var abc = frm.browsers.value;
    if (abc === "A")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212JNW9WR139D70085E3/ical.ics";
    else if (abc === "B")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I21263C4FA139C15D7BAC/ical.ics";
    else if (abc === "C")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212WPEPUP1396F85E02B/ical.ics";
    else if (abc === "D")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212NEKA9Y139E57D8DDA/ical.ics";
    else if (abc === "E")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212ETT9PK139C15F2C25/ical.ics";
    else if (abc === "F")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212Y6WMF4139C1C22637/ical.ics";
    else if (abc === "G")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212AT4NRY139C165DB97/ical.ics";
    else if (abc === "H")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212XH7AWH139C160ED75/ical.ics";
    else if (abc === "I")
        frm.text1.value = "https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I2123X6H36139C1C1A4E5/ical.ics";

}
</script>

<center>
<form name="form1">
Subscribe to your calendar link:
<select id="browsers" onchange="fifa()">
<option value="0">- choose a tutor -</option>
<option value="A">Ashley C.</option>
<option value="B">Danielle C.</option>
<option value="C">Jon S.</option>
<option value="D">Mekenna M</option>
<option value="E">Norma C.</option>
<option value="F">Tyler K.</option>
<option value="G">Vanessa A.</option>
<option value="H">Veronica G</option>
<option value="I">William K.</option>
</select><br><br>

<textarea name="text1" style="width:400px; height:100px;">

</textarea>
</form>

Featured Replies in this Discussion

  • I've ended shortening then script at the same time. I swapped your textarea out in favour of a div and put all your urls in a object literal. (could have been an associative array. Makes no difference really. ...
    Post Contains: Links Code
 
1
 

I've ended shortening then script at the same time. I swapped your textarea out in favour of a div and put all your urls in a object literal. (could have been an associative array. Makes no difference really.

<script type="text/javascript">

links = {
        A:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I21263C4FA139C15D7BAC/ical.ics",            
        B:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212NEKA9Y139E57D8DDA/ical.ics",
        C:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212WPEPUP1396F85E02B/ical.ics",
        D:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212NEKA9Y139E57D8DDA/ical.ics",
        E:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212ETT9PK139C15F2C25/ical.ics",
        F:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212Y6WMF4139C1C22637/ical.ics",
        G:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212AT4NRY139C165DB97/ical.ics",
        H:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I212XH7AWH139C160ED75/ical.ics",
        I:"https://ical.bookeo.com/20212KWWNLA1396F7FEA1BWFW3J6/LHRAKRK63FAMPJP6/Z/I2123X6H36139C1C1A4E5/ical.ics"    
};

function fifa()
{
    var link = document.getElementById("link");
    var frm = document.forms[0];
    var abc = frm.browsers.value;
    link.innerHTML = "<a href=\"" + links[abc] + "\">" + links[abc] + "<\/a>";
}
</script>
</head>
<body>
<center>
<form name="form1">
Subscribe to your calendar link:
<select id="browsers" onchange="fifa()">
<option value="0">- choose a tutor -</option>
<option value="A">Ashley C.</option>
<option value="B">Danielle C.</option>
<option value="C">Jon S.</option>
<option value="D">Mekenna M</option>
<option value="E">Norma C.</option>
<option value="F">Tyler K.</option>
<option value="G">Vanessa A.</option>
<option value="H">Veronica G</option>
<option value="I">William K.</option>
</select><br><br>

<div id="link" style="width:400px; height:100px;">
</div>
</form>
 
0
 

Perfect. And awesome!

Question Answered as of 2 Years Ago by theHop
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: