Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Javascript control of server controls
Message
De
04/02/2009 11:22:02
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Javascript control of server controls
Divers
Thread ID:
01379233
Message ID:
01379233
Vues:
64
In simplified language . . I have a webpage that contains a formview with 2 checkboxes inside its edititemtemplate. Checkbox1 is enabled and checkbox2 is disabled. The desired action is for checkbox2 to become enabled when checkbox1 is checked. I have a JS that will do this (almost). The JS is triggered by the onclick event of checkbox1.
Hmm . . It seems the website won't let me include the JS here. Anyone know how to do it?
The script is positioned inside the edititemstemplate so that the checkboxes do in fact exist when the script loads. My problem is that although the checked property changes as expected, the enabled property does not, UNLESS the default condition of the checkbox2 (dh410) is enabled. If its enabled by default, it will toggle back and forth just fine. But if the default condition is disabled it will not. I find that the framework compilation is wrapping the checkbox inside a span which is also set to disabled and it seems this is preventing the checkbox from being activated by the script. It looks like this
<span class="ckbox2" disabled="disabled"><input id="ctl00_ContentPlaceHolder1_FormView1_dh410CheckBox" type="checkbox" name="ctl00$ContentPlaceHolder1$FormView1$dh410CheckBox" disabled="disabled" /><label for="ctl00_ContentPlaceHolder1_FormView1_dh410CheckBox">4/10</label></span>
So, can someone here help me figure this out?
Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform