How to Add an Input Mask to the International Postal Code

/* * Custom input mask for the address field’s international scheme. * * @link https://wpforms.com/developers/how-to-add-an-input-mask-to-the-international-postal-code */ function wpf_dev_address_field_properties( $properties, $field, $form_data ) { if($field[ ‘scheme’ ] === ‘international’) { $properties[ ‘inputs’ ][ ‘postal’ ][ ‘class’ ][] = ‘wpforms-masked-input’; $properties[ ‘inputs’…Continue reading

How to Disable Browser Autocomplete for Form Fields – all fields

/** * Disable form autocomplete for all fields on a specific form * * @link https://wpforms.com/developers/disable-browser-autocomplete-for-form-fields/ */ function wpf_dev_disable_form_autocomplete( $form_atts, $form_data ) { // This check will only form autocomplete for Form #11. // Removing this check would disable autocomplete…Continue reading

How to Customize the Labels for Image Choices – Combined effect

form#wpforms-form-1000 .wpforms-field .wpforms-image-choices-item:hover .wpforms-image-choices-label { position: absolute; top: 0; left: 50%; transform: translateX(-50%); background-color: #f6f6f6; color: #333; padding: 20%; border-radius: 5px; opacity: 1; transition: opacity 0.3s ease-in-out; width: 100%; height: 100%; } form#wpforms-form-1000 .wpforms-image-choices label:hover { border: none; box-shadow: none;…Continue reading

How to Customize the Labels for Image Choices

/* Position labels over images and hide them by default */ form#wpforms-form-1000 .wpforms-field .wpforms-image-choices-label { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.7); text-align: center; display: flex; justify-content: center; align-items: center; opacity: 0;…Continue reading

How to Perform Field Comparisons Within Your WPForms

/** * Perform Field Comparisons * * @link https://wpforms.com/developers/how-to-perform-field-comparisons-within-your-wpforms/ */ function wpf_dev_compare_fields( $fields, $entry, $form_data ) { // Only run this snippet on the form ID 1000 if ( absint( $form_data[ ‘id’ ] ) !== 1000 ) { return $fields;…Continue reading

How to Add BCC to Email Notifications (for specific form)

/** * Add BCC recipients to specific form email notifications. * * @link https://wpforms.com/docs/how-to-add-bcc-to-email-notifications/ */ add_filter( ‘wp_mail’, function ( $args ) { // Use WPForms_Process object to get the form ID $wpforms_process = wpforms()->process; // Only run this snippet on…Continue reading

How to Automatically Submit a Form with a Field Choice – CSS

button#wpforms-submit-3046 { display: none; } form#wpforms-form-3046 span.wpforms-icon-choices-label { font-size: 0; } ul#wpforms-3046-field_3 li label:hover, ul#wpforms-3046-field_4 li label:hover, ul#wpforms-3046-field_3 li.wpforms-selected label, ul#wpforms-3046-field_4 li.wpforms-selected label { box-shadow: none; } form#wpforms-form-3046 ul.wpforms-icon-choices .wpforms-icon-choices-item label{ margin:0 auto; padding:0; } div#wpforms-3046-field_4-container { width: 20%; float:…Continue reading