HexagonJS
Form Changelog
2.2.0
hx-form.hx-flag-form
Added
Display the form using the updated structure. Intended for use with hx-input etc. Inputs and the hx-flag-button class.
1.17.1
Bugfix
Resolved an issue where form validation failed if using the new hx-form-buttons
1.14.0
hx.validateFormObject
Bugfix
#301
Fixed an issue where the validateForm function would validate against hidden elements
1.8.0
hx.validateFormObject
Updated
Updated the validation to show the error for the focused element instead of the first error it finds
1.5.1
Bugfix
#274
Resolved an issue with the alignment of buttons in forms
1.4.0
hx.validateFormObject
Updated
#211
Updated the error text to use userFacingText
1.0.0
hx.validateFormObject
Bugfix
Updated to include text areas in the error checking
0.14.0
hx.validateFormObject
Removed
Use hx.validateForm(selector, options) instead.
0.13.0
hx.validateFormObject
Deprecated
Use hx.validateForm(selector, options) instead.
hx.validateFormObject
Added
A helper function for validating forms. By default, it will show a message below the first error in the form but will return an array with all the errors.
An example use of this function could be:
hx.select('#form').select('button').on('click', function (event){
  event.preventDefault(); // Stops the form from submitting natively
  var validObj = hx.validateForm('#form');
  if(validObj.valid){
    // Do something on success
  }
  // Do nothing if the form isn't valid (as the validateForm function will show a message)
});
0.12.0
hx.validateFormObject
Added
A helper function for validating forms. By default, it will show a message below the first error in the form but will return an array with all the errors.
An example use of this function could be:
hx.select('#form').select('button').on('click', function (event){
  event.preventDefault(); // Stops the form from submitting natively
  var validObj = hx.validateForm('#form');
  if(validObj.valid){
    // Do something on success
  }
  // Do nothing if the form isn't valid (as the validateForm function will show a message)
});
0.11.0
hx-form
Updated
Updated the form styles to make the different types of field have a more consistent layout.