Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get value and link in same drop-down box?
Message
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00982044
Message ID:
00982068
Vues:
27
This message has been marked as a message which has helped to the initial question of the thread.
Hello Steve,

You can use the following javascript to navigate to a site :
window.location.href = "MySite.html". 
So you can add the following code to your AddValue function to get what you want:
function AddValue(cValue)
{
if (cValue  == "14K Gold")
{ 
  window.location.href  = "14k_gold.htm";
}
}
HTH

>I have a drop-down box like so:
>
>
><select name="D1" size="1" onChange="AddValue(this.value);">
>    <option value="14K Gold">14K Gold</option>
>    <option value="10K Gold">10K Gold</option>
>    <option value="Sterling Silver">Sterling Sliver</option>
>    <option value="Gold Plated">Gold Plated</option>
> </select>
>
>
>Can I add the following code to the existing 14K Gold option value line so that when someone choses 14K Gold it saves the value, but also takes the user to the 14k_gold.htm web page? If so, how would the line of code look?
>
>
><a href="14k_gold.htm"></a>
>
>
>I tried putting this code inside the drop-down list option value lines above, but it does not work and does not go to the linked page. Or do I have to have two identical, but separate drop-down lists to make this work?
>
>Thanks ahead of time for your help.
Zakaria al Azhar
My blog on Actuaris.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform