Skip to main content

validate_form

Function validate_form 

Source
pub fn validate_form(form: &mut FormConfig)
Expand description

Walk the form’s fields and apply the basic validation rules:

  • Required: empty value on a required field → "This field is required".
  • Email: non-empty Email value missing @"Invalid email address".
  • Number: non-empty Number value that doesn’t parse as f64"Must be a valid number".

The first failing rule per field wins; the function never panics or unwraps. Empty optional fields skip the type-specific checks.