Script Categories













Menus and Navigation >>> Dynamic Links.

Dynamically change the link address for a hyperlink based on their entry in the pulldown menu. Send to different email addresses or URLs!

do you want to ... do it!

Add the below code to the <body> section of your page:

<form name="addresses">
do you want to ... <select name="list" onChange="update()">
<option
value="mailto:admin@some-site.com">email admin@some-site.com
<option value="mailto:support@some-site.com">email support@some-site.com
<option value="http://www.yaldex.com">go to www.yaldex.com
</select>
<a href="updatelink">do it!</a>
</form>

<script language="javascript" type="text/javascript">      
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!--  begin
pos = 9999;
for(num=0;num<document.links.length;num++) {
if (document.links[num].href.indexOf("updatelink") != -1) {
pos = num;
num = 5000;
   }
}
function update() {
if (pos!=9999) {
sel = document.addresses.list.selectedIndex;
document.links[pos].href = document.addresses.list[sel].value;
   }
}
update();
// end -->
</script>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©