Formr Formr Versions Save

Create and Validate PHP Forms in Seconds.

v.1.4.2

2 years ago

Misc. bug fixes.

v1.4.1

2 years ago
  • Finally! Error messages will now appear under each form element if $form->inline_errors is set to TRUE.

  • Added a cURL option for use with reCAPTCHA.

  • Fixed an issue with date and datetime validation.

v1.4

2 years ago

Formr 1.4

Possible Breaking Changes

Formr now defaults to Bootstrap 5 when instantiating Formr with the 'Bootstrap' parameter.

$form = new \Formr\Formr('bootstrap'); // defaults to Bootstrap 5

Validation

Formr no longer uses FILTER_SANITIZE_STRING in the sanitize_string validation rule as it's been depreciated in PHP 8. The rule now uses strip_tags().


Added

Added a nowrap switch to remove bootstrap and bulma element <div> wrappers.

$form = new \Formr\Formr('bootstrap', 'nowrap');

Added a honeypot method for inserting a honeypot into the form.

$form->honeypot('company_name');

Fixed

Fixed an issue where Formr would not add the default Bootstrap or Bulma element class (e.g.; form-control) when adding custom classes to an element.

Fixed an issue where inline help text was not properly displayed when using Bootstrap 5.

Removed (int) casting from some validation methods as it was preventing the use of floats.

Fixed an issue where 0 (zero) would not work in the greater_than_or_equal validation rule.

v1.3.7

2 years ago

New

Implemented basic support for Bootstrap 5

$form = new \Formr\Formr('bootstrap5');

Fixed

Made open elements self-closing, e.g.; />. Fixed an issue with Bulma checkboxes not appearing inline.

1.3.6

2 years ago

Added ability to change messages() error message heading text

$form->error_heading_plural = 'Please Correct the Following Errors';
$form->error_heading_singular = 'Please Correct the Following Error';

Updated redirect() method and added a default value for redirecting to the same page, plus added exit after the redirect.

Fixed an issue where flash messages would not print properly in hush mode.

1.3.5

2 years ago

Added Fieldsets to FastForm

$data = [
  'fieldset1' => [
    'legend' => 'Name & Email',
    'fields' => [
      'text1' => 'name,Name',
      'email' => 'email,Email',
    ],
  ],
  'fieldset2' => [
    'legend' => 'Address',
    'fields' => [
      'text2' => 'address,Address',
      'text3' => 'city,City',
      'select' => 'state,State,,,,,,states',
      'number' => 'zip,Zip',
    ],
  ],
  'textarea' => 'comments,Comments'
];

$form->fastform($data);

1.3.4

2 years ago

Formr 1.3.4

New Parameter

Added $form->recaptcha_action_name to the reCAPTCHA JavaScript so you can differentiate forms via actions in the reCAPTCHA Admin panel.

New Method

Added a new clear() method to empty the $_POST super global after a form submission.

if($form->submitted())
{
    $name = $form->post('name');
    $email = $form->post('email');
    
    if($form->ok()) {
        $form->clear();
    }
}

Fixed an issue with FastForm arrays not handling hidden elements properly (based off of 81c4dc7e07f2727073c871891a8b1e934714a446) Removed <fieldset> from FastForm Cleaned up some code

1.3.3

3 years ago

Formr 1.3.3

reCAPTCHA v3

Added support for Google reCAPTCHA v3. ReCheck out the blog post for more info.

Multiple Forms

It's easier than ever to work with multiple forms on one page. You no longer have to add hidden fields and check if they were submitted, Formr will now do this automatically. Check out the blog post to see how.

Validation Arrays

You can now add your validation rules as an array!

if($form->submitted()) {
    $name = $form->post('name', '', ['min[3]', 'max[60]', 'not_regex[/foo|bar/]']);
}

New Validation Rule

Added a required validation rule (how did I overlook this?!).

Fixed

Fixed an issue with labels not working properly in FastForm.

1.3.2

3 years ago

Bug fixes

1.3.1

3 years ago

Bug fixes