snippet-library icon indicating copy to clipboard operation
snippet-library copied to clipboard

`gw-require-unique-values.php`: Added support to required unique inputs for name field type.

Open barthc opened this issue 1 year ago • 1 comments
trafficstars

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/2583004576/65519

Summary

Added support to required unique inputs for name field type. Original request was specifying the inputs id,(not sure if the user can specify the input ids correctly as they are not visible on the editor) but trying to keep it simple by requiring unique value for all inputs.

barthc avatar May 10 '24 13:05 barthc

Warnings
:warning: When ready, don't forget to request reviews on this pull request from your fellow wizards.

Generated by :no_entry_sign: dangerJS against 87d8f8c3a8d2dcf8f18fef0dfa3667726b485f7c

github-actions[bot] avatar May 10 '24 13:05 github-actions[bot]

add_filter( sprintf( 'gform_field_validation_%s', $this->_args['form_id'] ), array( $this, 'validate' ), 10, 4 );
add_filter( sprintf( 'gform_field_validation_%s', $this->_args['form_id'] ), array( $this, 'validate_field_input' ), 11, 4 );

@claygriffiths The first filter will support 'field_ids' => array( 1.3, 1.6, 2 ), // able to mix inputs and regular fields while the second filter will support 'field_ids' => array( 1.3, 1.6 ),

barthc avatar May 21 '24 09:05 barthc