[Chameleon] javascript to turn on a layer
JR Santillan
dgr8_39991 at yahoo.com
Wed Mar 15 03:30:30 EST 2006
Julien, thanks for the script.
I tried it but nothing happened.
I trying to find out what the problems are. I hope anybody could help.
Thanks.
Julien-Samuel Lacroix <jlacroix at mapgears.com> wrote: Hello,
Your funciton should look like:
function becomeAerial()
{
for(i=0;document.forms[0].elements['legendlayername[]'][i];i++)
{
if(document.forms[0].elements['legendlayername[]'][i].value=="Aerial")
{
document.forms[0].elements['legendlayername[]'][i].checked=true;
}
}
document.forms[0].submit();
}
Note that:
- the forms take an 's'
- the access to form elements with '[]' in the names is special.
- in the if() statement, the value should be equal (==) to "Aerial" not
different (!=).
Julien
---------------------------------
Yahoo! Mail
Use Photomail to share photos without annoying attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060315/35417117/attachment.html
More information about the Chameleon
mailing list