Hello there again.<br><br>I tried the script Julien posted and I found out that the script will only work if the visibility in the LegendTemplate widget is set to "true"... and if the "checkboxes" in the legend_template.html file is included...<br><br>However, the primary reason why I wanted to use a javascript is to avoid displaying the legend in my application that will also avoid the checking and unchecking of the layers in the legend.<br><br>Any help out there to work this out?<br><br>Thanks again.<br><br><br>Jojin<br><br><br><blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><b><i>Julien-Samuel Lacroix <jlacroix@mapgears.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hello,<br>Your funciton should look like:<br><br> function becomeAerial()<br> {<br>
for(i=0;document.forms[0].elements['legendlayername[]'][i];i++)<br> {<br> <br>if(document.forms[0].elements['legendlayername[]'][i].value=="Aerial")<br> {<br> <br>document.forms[0].elements['legendlayername[]'][i].checked=true;<br> }<br> }<br> document.forms[0].submit();<br> }<br><br>Note that:<br>- the forms take an 's'<br>- the access to form elements with '[]' in the names is special.<br>- in the if() statement, the value should be equal (==) to "Aerial" not <br>differ! ent (!=).<br><br>Julien<br></blockquote><br><div> </div><hr size="1"> Yahoo! Mail<br> <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=38867/*http://photomail.mail.yahoo.com">Use Photomail</a> to share photos without annoying attachments._______________________________________________<br>Chameleon mailing list<br>Chameleon@lists.maptools.org<br>http://lists.maptools.org/mailman/listinfo/chameleon<br></blockquote><br><p>
        
                <hr size=1> Yahoo! Mail<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/pmall2/*http://photomail.mail.yahoo.com">Use Photomail</a> to share photos without annoying attachments.