We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @Gregwar, It seems that constraint acts weird in some cases, as you mentioned here.
When I set the following fields to 0 and submit the form :
0
text
number
HTML
<form> <input type="text" name="items_per_page_1"> <input type="number" name="items_per_page_2"> <!-- ... --> </form>
PHP
$form = new Gregwar\Formidable\Form('forms/myform.html'); $form->addConstraint('items_per_page_1', function($value) { if (!is_numeric($value)) return 'NUMERIC_ONLY'; if ((int)$value <= 0) return 'GREATER_THAN_ZERO'; }); $form->addConstraint('items_per_page_2', function($value) { /* Same constraint */ }); echo $form;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @Gregwar, It seems that constraint acts weird in some cases, as you mentioned here.
When I set the following fields to
0
and submit the form :text
input throw the desired error (greater than zero)number
input does not throw this errorHTML
PHP
The text was updated successfully, but these errors were encountered: