Validates user input (usually from an HTML form) based