3
How do I force at least one of the two fields to be mandatory (is filled)? For example, the fields Celular
and Telefone
cannot be saved empty, only one of them.
My code:
//..
}
else ((txtNome.Text == "") || (maskedCPF.Text == "") || (maskedCEP.Text == "") || (txtNum.Text == "") || (maskedCelular.Text == "") || (txtTelefone.Text == ""))
{
MessageBox.Show("Os Campos com * são de Preenchimentos Obrigatórios!");
}
In this case it is forcing the two fields (Cellular and Telephone) to be filled. I want it to be possible to save with the filled cell field and the empty phone field or vice versa.
That’s right.vlw.
– enzo
@Take a look at the [tour] besides accepting a reply you can vote on everything you find interesting in the whole site.
– Maniero
@Maniero why conditions are between parentheses?
– Mateus Daniel
@Mateusdaniel Probably because the person wants to make more explicit, I would not.
– Maniero
@Maniero ops, sorry, I thought that was part of your solution'
– Mateus Daniel