I have two textbox that corresponds to the my two combobox.
if (purposecb.Text == "-Select One-")
{
MessageBox.Show("Please select the purpose of the visitor's visit.", "message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
purposecb.Focus();
}
else if (placevisitcb.Text == "-Select One-")
{
MessageBox.Show("Please select the place where the visitor would visit.", "message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
placevisitcb.Focus();
}
else if (purposecb.Text == "-Others Specify-")
{
if (specifypurposetb.Text.Length == 0)
{
MessageBox.Show("Please specify the purpose of the visitor's visit.", "message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
specifypurposetb.Focus();
}
}
else if (placevisitcb.Text == "-Others Specify-")
{
if (specifyplacetb.Text.Length == 0)
{
MessageBox.Show("Please specify the place where the visitor would visit.", "message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
specifyplacetb.Focus();
}
}
the conditions stops on this line
if (specifypurposetb.Text.Length == 0)
{
MessageBox.Show("Please specify the purpose of the visitor's visit.", "message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
specifypurposetb.Focus();
}
Once the condition above becomes false, the conditions after it doesn't work. As if it's the stopping line of the condition.
The code I provided are only part of a larger condition.