Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 27 Mar 2008 16:39:37 +0100,    group: microsoft.public.dotnet.languages.jscript        back       


Enable an asp control runat server via javascript, until this control is not enable from server   
I have seen that if I put a radiolistbutton on a page with 3 radiobutton and 
the first (as example) is not enable at design time (so server side), i 
can't enable it from javascript with something like this

var btlList = document.form1.elements["RadioButtonList1"];

btlList[0].disabled = false;


This because of its rendering in HTML

<table id="RadioButtonList1" border="0">
    <tr>

  <td><span disabled="disabled"><input id="RadioButtonList1_0" type="radio" 
name="RadioButtonList1" value="pippo" disabled="disabled" /><label 
for="RadioButtonList1_0">pippo</label></span></td>
 </tr>

<tr>
  <td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" 
value="pluto" /><label for="RadioButtonList1_1">pluto</label></td>
 </tr><tr>
  <td><input id="RadioButtonList1_2" type="radio" name="RadioButtonList1" 
value="paperino" /><label for="RadioButtonList1_2">paperino</label></td>
 </tr>
</table>

Do you see? There's a "span" which is disabled. So from javascript i can 
enable the radioButton, but the span is still disabled, so the children.. 
radiobutton

I can solve that? PLS HELP!

Thank you all
date: Thu, 27 Mar 2008 16:39:37 +0100   author:   Fabio Mastria

Re: Enable an asp control runat server via javascript, until this control is not enable from server   
"Fabio Mastria"  wrote in message
news:9F5D8385-2AB8-4B07-B06C-6E438EAE1E45@microsoft.com...
> I have seen that if I put a radiolistbutton on a page with 3 radiobutton
and
> the first (as example) is not enable at design time (so server side), i
> can't enable it from javascript with something like this
>
> var btlList = document.form1.elements["RadioButtonList1"];
>
> btlList[0].disabled = false;
>
>
> This because of its rendering in HTML
>
> <table id="RadioButtonList1" border="0">
>     <tr>
>
>   <td><span disabled="disabled"><input id="RadioButtonList1_0"
type="radio"
> name="RadioButtonList1" value="pippo" disabled="disabled" /><label
> for="RadioButtonList1_0">pippo</label></span></td>
>  </tr>
>
> <tr>
>   <td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1"
> value="pluto" /><label for="RadioButtonList1_1">pluto</label></td>
>  </tr><tr>
>   <td><input id="RadioButtonList1_2" type="radio" name="RadioButtonList1"
> value="paperino" /><label for="RadioButtonList1_2">paperino</label></td>
>  </tr>
> </table>
>
> Do you see? There's a "span" which is disabled. So from javascript i can
> enable the radioButton, but the span is still disabled, so the children..
> radiobutton
>
> I can solve that? PLS HELP!
>

var btn = document.getElementById("RadioButtonList1_0")
btn.disabled = false
btn.parentNode.disabled = false

-- 
Anthony Jones - MVP ASP/ASP.NET
date: Thu, 3 Apr 2008 23:06:02 +0100   author:   Anthony Jones

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us