Jump to content

click on link to display dropdown help needed pls


helloise

Recommended Posts

how can i do this pls?

 

i just want to display a link "Free Chat" when i click on it, it must display a dropdown with options "yes" and "no"

the link must not go anywhere yet, only when yes is selected it must go to a page

i have the code:

<a href="" id="link" name="link" onClick="yesnolist(1)">Free Chat</a>

 

then i have javascript:

<script type="text/JavaScript">
  function yesnolist()
  {
      var e = document.getElementById("link");
      var strUser1 = e.options[e.selectedIndex].value;
      if (strUser1 == "1")
      {
          window.location.href = "http://.........";
      }
      return strUser1;
  }
</script>

 

the above is not correct, can some-one help me please?

thanks

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.