asp.net radiobutton

if RdoProjectSpecialHazardYes.checked then TxtProjectSpecialHazardDescription.readonly == false
if RdoProjectSpecialHazardNo.checked then TxtProjectSpecialHazardDescription.readonly == true

How to add both condition in asp.net / c#? I would like code behind to do the validation check.

Thanks

<cc1:OboutRadioButton  
                        FolderStyle="../app/UIStyleControls/Obout/Interface/styles/plain/OboutRadioButton" 
                        ID="RdoProjectSpecialHazardYes" runat="server" Text="YES" 
                        GroupName="RdoProjectSpecialHazard" 
                        ></cc1:OboutRadioButton>
           
                    <cc1:OboutRadioButton  
                        FolderStyle="../app/UIStyleControls/Obout/Interface/styles/plain/OboutRadioButton" 
                        ID="RdoProjectSpecialHazardNo"  runat="server" Text="NO"                           
                        GroupName="RdoProjectSpecialHazard"             
                        ></cc1:OboutRadioButton>
                        <br /><br />
              
                  <cc1:OboutTextBox    
                 ToolTip="Please describe..." 
                 ID="TxtProjectSpecialHazardDescription" 
                 TextMode="MultiLine" Height="100" Width="300" runat="server">
                 </cc1:OboutTextBox></div>

Open in new window

Webboy2008Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nishant joshiTechnology Development ConsultantCommented:
using C# it is possible but which is not a good solution for this task..


added a code with JQuery.Check..


Regards,
<cc1:OboutRadioButton  
                        FolderStyle="../app/UIStyleControls/Obout/Interface/styles/plain/OboutRadioButton" 
                        ID="RdoProjectSpecialHazardYes" runat="server" Text="YES" 
                        GroupName="RdoProjectSpecialHazard" onclick="javascript:RadioClick();"
                        ></cc1:OboutRadioButton>
           
                    <cc1:OboutRadioButton  
                        FolderStyle="../app/UIStyleControls/Obout/Interface/styles/plain/OboutRadioButton" 
                        ID="RdoProjectSpecialHazardNo"  runat="server" Text="NO"                           
                        GroupName="RdoProjectSpecialHazard" onclick="javascript:RadioClick();"            
                        ></cc1:OboutRadioButton>
                        <br /><br />
              
                  <cc1:OboutTextBox    
                 ToolTip="Please describe..." 
                 ID="TxtProjectSpecialHazardDescription" 
                 TextMode="MultiLine" Height="100" Width="300" runat="server">
                 </cc1:OboutTextBox></div>

Open in new window

function RadioClick(){
if($("#RdoProjectSpecialHazardYes").attr('Checked')){
$("#TxtProjectSpecialHazardDescription").attr("ReadOnly","true");
}
if($("#RdoProjectSpecialHazardNo").attr('Checked')){
$("#TxtProjectSpecialHazardDescription").attr("ReadOnly","fa;se");
}
}

Open in new window

0
Webboy2008Author Commented:
your codes do not seem working
0
Webboy2008Author Commented:
and i prefer code behind since most of codes using code behind for validation. Thanks
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

käµfm³d 👽Commented:
Try like this:

TxtProjectSpecialHazardDescription.readonly = ((!RdoProjectSpecialHazardYes.checked || RdoProjectSpecialHazardNo.checked) ? true : false);

Open in new window

0
Webboy2008Author Commented:
can u show me in if statement?
0
käµfm³d 👽Commented:
That is an if statement!

See:  http://en.wikipedia.org/wiki/%3F:
0
käµfm³d 👽Commented:
The colon at the end of the URL in the above comment is a part of the link. Clicking the link takes you to the wrong document. The following link is a shortened version of the one above, and it describes an "inline if":  http://rdsrc.us/KwOQNf
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.