...

View Full Version : onChange function dropdown to link



rico01
12-14-2010, 07:22 PM
Hi there,

I have a drop down menu that runs a function when one of the options are chosen. Is there a way to have this run from individual links?

<select name="users" onChange="showUser(this.value)">
<option value="">Select a Deer:</option>
<option value="1">8002</option>
<option value="2">8009</option>
<option value="3">8011</option>

Thanks :)

Rich

Philip M
12-14-2010, 07:35 PM
Hi there,

I have a drop down menu that runs a function when one of the options are chosen. Is there a way to have this run from individual links?

<select name="users" onChange="showUser(this.value)">
<option value="">Select a Deer:</option>
<option value="1">8002</option>
<option value="2">8009</option>
<option value="3">8011</option>

Thanks :)

Rich

Is this what you want?


<a href= "#" onclick = showUser(1); return false;>8002</a>
<a href= "#" onclick = showUser(2); return false;>8009</a>
<a href= "#" onclick = showUser(3); return false;>8011</a>

<script type = "text/javascript">
function showUser(which) {
alert (which);
}
</script>


I can't remember a start like this in living memory. - Sky Sports

rico01
12-14-2010, 07:46 PM
Thanks for your reply mate,

It works perfectly :)

Cheers!

RIch



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum