Evaluate Multiple In One Statement
How would one evaluate 3 fields to determine if they are blank? I am creating an intranet page for my company, and the login screen requires the users 1st name, users last name and their company id. What I am needing to do is if all 3 fields are blank, highlight (and by highlight I mean backcolor) all 3 textboxes red (txtFirstName, txtLastName, txtComID), if 1st Name is entered BUT the other 2 fields remain null, then only highlight txtLastName and txtComID Red. What is the way to evaluate in C# to check all 3 fields and only highlight RED the field's that are null?
VulpesPosted Jan 16, 2013, 5:06 PM
Phani BhushanPosted Jan 17, 2013, 12:29 AM
VulpesPosted Jan 16, 2013, 5:45 PM
txtFirstName.Text = txtFirstName.Text.Trim();
txtLastName.Text = txtLastName.Text.Trim();
txtComID.Text = txtComID.Text.Trim();
richard smithPosted Jan 16, 2013, 5:42 PM
One other question...how could I trim out an extra space in the fields? For example, let's say the user input a space after entering there ComID, instead of causing that to fail the validation check, is there a way to programatically remove the blank space at the end?