snippet-library
snippet-library copied to clipboard
`gw-require-unique-values.php`: Added support to required unique inputs for name field type.
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.
| 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
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 ),