This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > how to call javascript on form select change?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author how to call javascript on form select change?
Dog

2004-08-26, 12:20 pm

hi,

i've got a javascript which is currently called from a link and shows/hides
a table when clicked...

the problem is i'd like to call the script from a select box so that a
different table is visible depending on which option is chosen from the
dropdown....

can anyone help me with the javascript for the select box?

cheers

dog



heres some of the scripts in case it helps :

the current link calling the script : <A onclick='blocking("1"); return
false' href="#">xxx </A

and the script itself.....

<SCRIPT language=JavaScript>
var supported = (document.getElementById || document.all);
if (supported)
{
document.write("<STYLE TYPE='text/css'>");
document.write(".para {display: none}");
document.write("</STYLE>");

function blocking(i)
{

alert('This link does not work in your browser.');
return;
}
shown[i] = (shown[i]) ? false : true;
current = (shown[i]) ? 'block' : 'none';
if (document.getElementById)
{
document.getElementById('table'+i).style.display = current;
}
else if (document.all)
{
document.all['table'+i].style.display = current;
}

</SCRIPT>


Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews