Hello,
I have a field Bench.name in a form. This field is marked Required and thus the end users are required to enter data. However, some users are just entering spaces to skip this field and the form is saving it.
In order to avoid this situation, I am doing the below PHP validation before Saving and converting to uppercase and trimming. After trimming, data entered only as blank spaces, becomes empty. However the empty data also gets saved, which is a nuisance.
$this->data("Bench.name", trim(strtoupper($this->data("Bench.name", ""))), true);
If any one can help me in guiding on how to resolve this issue, I will be very much thankful. FYI, I have declared this field as NOT NULL in database table level. But database is also not enforcing.
I have a field Bench.name in a form. This field is marked Required and thus the end users are required to enter data. However, some users are just entering spaces to skip this field and the form is saving it.
In order to avoid this situation, I am doing the below PHP validation before Saving and converting to uppercase and trimming. After trimming, data entered only as blank spaces, becomes empty. However the empty data also gets saved, which is a nuisance.
$this->data("Bench.name", trim(strtoupper($this->data("Bench.name", ""))), true);
If any one can help me in guiding on how to resolve this issue, I will be very much thankful. FYI, I have declared this field as NOT NULL in database table level. But database is also not enforcing.