Skip to main content

Require Validation for Internal/Administrative Form Submissions

When you use the "New registration" link on a form internally, you can bypass validation. In other words: required fields, data types, format masks, and maximum/minimum counts are not enforced on administrative form responses. When clicking Submit, if there are issues on the form, the following dialog will display:

Dialog shown when submitting internal registration with errors

Clicking "OK" submits the form. This is a great feature for constituent-facing forms that may need to be managed manually by staff. However, there may be forms where even staff should be required to pass validation.

You can achieve this by adding the following to Edit Scripts / Styles > Custom Scripts section of the form:

$('button.form_button_submit').off().on('click', function(e) {
  if (Form.Validate()) FW.Lazy.Commit(this, { cmd: 'submit' });
  return false;
});

This code forces the Submit button to always validate the form before submission, even on an internal registration.

If you're using the script inside a content block, make sure to wrap it in a jQuery callback so it only runs once the DOM is ready: $(function() { //code here });