Click here to Skip to main content
15,914,394 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
ZurdoDev30-Jun-16 10:28
professionalZurdoDev30-Jun-16 10:28 
AnswerRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Codeaddict742330-Jun-16 10:35
Codeaddict742330-Jun-16 10:35 
Hello,

Thanks for the quick reply.
I am trying to have three textboxes and one radiobuttonlist have its requiredfieldvalidators disabled based on a previous radiobuttonlist.

My code behind is as follows:
------------
C#
protected void rbCurrentlyEmployed_SelectedIndexChanged(object sender, EventArgs e)

           {

           if (rbCurrentlyEmployed.SelectedValue == "No" || rbCurrentlyEmployed.SelectedValue == "Retired" )

               ((RequiredFieldValidator)txtEmployer.FindControl("RFV_Employment_Employer")).Enabled = false;
               ((RequiredFieldValidator)txtJobTitle.FindControl("RFV_Employment_JobTitle")).Enabled = false;
               ((RequiredFieldValidator)txtWorkPhone.FindControl("RFV_Employment_WorkPhone")).Enabled = false;
               ((RequiredFieldValidator)rbgrantsmatchingfunds.FindControl("RFV_Employment_MatchingFunds")).Enabled = false;

           else

           {
               ((RequiredFieldValidator)txtEmployer.FindControl("RFV_Employment_Employer")).Enabled = true;
               ((RequiredFieldValidator)txtJobTitle.FindControl("RFV_Employment_JobTitle")).Enabled = true;
               ((RequiredFieldValidator)txtWorkPhone.FindControl("RFV_Employment_WorkPhone")).Enabled = true;
               ((RequiredFieldValidator)rbgrantsmatchingfunds.FindControl("RFV_Employment_MatchingFunds")).Enabled = true;

           }
       }

-----------------

I seem to be getting an error in the syntax of the 'else' statement.

ANY help would be greatly appreciated
GeneralRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Richard Deeming30-Jun-16 10:52
mveRichard Deeming30-Jun-16 10:52 
GeneralRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Codeaddict742330-Jun-16 11:16
Codeaddict742330-Jun-16 11:16 
GeneralRe: Radiobuttonlist choice disables requiredfieldvalidator in textboxes and other radiobuttonlist Pin
Richard MacCutchan30-Jun-16 22:26
mveRichard MacCutchan30-Jun-16 22:26 
QuestionAngularjs is not refreshing data on the CSHTML page Pin
indian14330-Jun-16 2:39
indian14330-Jun-16 2:39 
AnswerRe: Angularjs is not refreshing data on the CSHTML page Pin
John C Rayan30-Jun-16 21:24
professionalJohn C Rayan30-Jun-16 21:24 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
indian1431-Jul-16 0:40
indian1431-Jul-16 0:40 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
John C Rayan1-Jul-16 1:18
professionalJohn C Rayan1-Jul-16 1:18 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
indian1431-Jul-16 4:15
indian1431-Jul-16 4:15 
GeneralRe: Angularjs is not refreshing data on the CSHTML page Pin
John C Rayan4-Jul-16 0:22
professionalJohn C Rayan4-Jul-16 0:22 
QuestionWhen to use ASP.NET Webforms, MVC, Web API Pin
larsp77729-Jun-16 0:04
larsp77729-Jun-16 0:04 
AnswerRe: When to use ASP.NET Webforms, MVC, Web API Pin
F-ES Sitecore30-Jun-16 1:03
professionalF-ES Sitecore30-Jun-16 1:03 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
larsp77730-Jun-16 1:37
larsp77730-Jun-16 1:37 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
F-ES Sitecore30-Jun-16 2:12
professionalF-ES Sitecore30-Jun-16 2:12 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
larsp77730-Jun-16 2:22
larsp77730-Jun-16 2:22 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
F-ES Sitecore30-Jun-16 3:02
professionalF-ES Sitecore30-Jun-16 3:02 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
larsp77730-Jun-16 3:13
larsp77730-Jun-16 3:13 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
Ronald.A11-Jul-16 4:05
Ronald.A11-Jul-16 4:05 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
Ronald.A11-Jul-16 3:47
Ronald.A11-Jul-16 3:47 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
larsp77711-Jul-16 3:56
larsp77711-Jul-16 3:56 
GeneralRe: When to use ASP.NET Webforms, MVC, Web API Pin
Ronald.A11-Jul-16 4:03
Ronald.A11-Jul-16 4:03 
QuestionLooking for help implementing a progress bar in ASP Pin
turbosupramk328-Jun-16 9:35
turbosupramk328-Jun-16 9:35 
AnswerRe: Looking for help implementing a progress bar in ASP Pin
turbosupramk328-Jun-16 11:05
turbosupramk328-Jun-16 11:05 
GeneralRe: Looking for help implementing a progress bar in ASP Pin
trust trinity4-Jul-16 8:27
trust trinity4-Jul-16 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.