Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to write code that checks a checkbox if all of these fields have a value


Text txtSSN.Text =
Text txtMemberConfirmed.Text =
Text txtDateOfBirth.Text =
Dropdown List ddlClearanceITem.SelectedValue =
Dropdown List ddlVisitorRqClose.SelectedValue =
Checkbox chkClientSiteAccess1.Checked =
Checkbox chkBadgeIssued1.Checked =
Checkbox chkKeysIssued1.Checked =
Checkbox chkDeskKeys.Checked =
Posted

What are you stumped on?

A single If statement with a lot of tests:

C#
if ((textSSN.Text.Length > 0) && (txtMemberConfirmed.Text.Length > 0) && ...)
{
  //check the checkbox
}
else
{
  //uncheck the checkbox
}
 
Share this answer
 
thank you very much for responding.

I'm getting errors on the syntax for the text and the dropdownlist.

How should the syntax for the dropdownlist be stated?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900