I\'m allowing a user to use either one of two textboxes to search a database - one is an ID field, and one is a freetext field. I\'m using ASP.NET with C# btw.
Anyway, a
I +1'ed Jamiec 's answer, but you still have to have some logic for those who don't have JS enabled. Maybe use the ID field as a priority if BOTH field's are populated.
if ((!box1.IsNullOrEmpty) & (!box2.IsNullOrEmpty)) {
// Evaluate box1 (since box1 is the ID field)
} else {
if ((!box1.IsNullOrEmpty)) {
// Evaluate box1
} else {
// Evaluate box2
}
}