ArtiGrid
v2.0

Validations Email

This demo shows how to use validation_email() and validation_required() for the email field. The required(false) makes other fields optional, while validation_required('email') makes the email field required, and validation_email(['email']) validates its format (e.g., must be a valid email address). Try submitting the form with an invalid email to see the validation in action.


<?php
    $grid = new ArtiGrid();
    $grid->table('employees')
        ->template('bootstrap5')
        ->required(false)
        ->validation_required('email')
        ->validation_email(['email']);
    echo $grid->render('insert');
?>