Skip to content

v3.7.0

Latest

Choose a tag to compare

@ovx ovx released this 20 Nov 05:13

Highlights

You can now choose which form fields the widget sends to verifyUrl when serverVerificationFields is enabled. Email fields are now included by default.

New Features

serverVerificationFieldsSelector

A CSS selector for the form fields whose values are sent in the server verification request.

  • Default: 'input[type="text"]:not([data-no-spamfilter]), input[type="email"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'
  • Fields that are not part of the widget's form are never collected. This includes controls linked to the form with the form attribute.
widget.configure({
	serverVerificationFields: true,
	serverVerificationFieldsSelector: 'input[type="text"], input[type="tel"], textarea'
});

serverVerificationFieldNames

A list of field names to send in the server verification request. When the list is not empty, it overrides serverVerificationFieldsSelector. Names match any form control (input, textarea, select), and the data-no-spamfilter attribute does not exclude them.

  • Default: []
widget.configure({
	serverVerificationFields: true,
	serverVerificationFieldNames: ['email', 'message']
});

Behavior Changes

  • The default selector now includes input[type="email"]. If you enable serverVerificationFields and keep the default selector, email field values are now sent to verifyUrl. To keep a field out, add the data-no-spamfilter attribute to it, or set serverVerificationFieldsSelector / serverVerificationFieldNames yourself.

Upgrade Notes

  • Nothing changes if serverVerificationFields is disabled. It is disabled by default.
  • To keep the previous behavior exactly, set:
widget.configure({
	serverVerificationFieldsSelector:
		'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])'
});