Title: Additional checkout block fields &#8211; validation
Last modified: July 15, 2025

---

# Additional checkout block fields – validation

 *  Resolved [vladimir5](https://wordpress.org/support/users/vladimir5/)
 * (@vladimir5)
 * [11 months ago](https://wordpress.org/support/topic/additional-checkout-block-fields-validation/)
 * Hello, you provide an example of validation can also be against other fields 
   in your documentation:
 * [https://developer.woocommerce.com/docs/block-development/cart-and-checkout-blocks/additional-checkout-fields/#conditional-visibility-and-validation-via-json-schema](https://developer.woocommerce.com/docs/block-development/cart-and-checkout-blocks/additional-checkout-fields/#conditional-visibility-and-validation-via-json-schema)
 *     ```wp-block-code
       woocommerce_register_additional_checkout_field(		array(			'id'                => 'plugin-namespace/alt-email',			'label'             => 'Confirm our email address',			'location'          => 'contact',			'type'              => 'text',			'required'          => true,			'attributes'    => array(					'autocomplete'     => 'off',			),			'sanitize_callback' => function ( $field_value ) {				return sanitize_email( $field_value );			},			'validation' => array(				"type" => "string",				"format" => "email",				"not" => array(					"const" => array(						"$data", "0/customer/billing_address/email"					)				),				"errorMessage" => "Please ensure your email address matches the confirmation.",			),		)	);
       ```
   
 * Variable `$data` should to refer to the current field value, but it makes an 
   error. Please help.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [shahzeen(woo-hc)](https://wordpress.org/support/users/shahzeenfarooq/)
 * (@shahzeenfarooq)
 * [11 months ago](https://wordpress.org/support/topic/additional-checkout-block-fields-validation/#post-18556173)
 * Hi there,
 * Thanks for reaching out!
 * Please note that we’re unable to provide support for custom code or customizations,
   including advanced validation logic for checkout fields.
 * However, if you believe the example code provided in the official documentation
   isn’t working as expected, we recommend sharing your feedback directly with the
   WooCommerce development team. You can do that here:
   👉 [https://developer.woocommerce.com/docs/contribution/testing/beta-testing/#giving-feedback](https://developer.woocommerce.com/docs/contribution/testing/beta-testing/#giving-feedback)
 * They’ll be able to review and address any potential issues in the documentation
   or implementation.
 * Alternatively, you can also ask your development questions in the [ WooCommerce Community Slack](https://woocommerce.com/community-slack/)
   as custom code falls outside our usual [scope of support](https://woocommerce.com/support-policy/#customization).
 *  [LovingBro (woo-hc)](https://wordpress.org/support/users/lovingbro/)
 * (@lovingbro)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/additional-checkout-block-fields-validation/#post-18573495)
 * Hi [@vladimir5](https://wordpress.org/support/users/vladimir5/), we haven’t heard
   back from you in a while, so I’m going to mark this as resolved. If you have 
   any further questions, please don’t hesitate to contact us here or start a new
   thread.
 * We’d appreciate it if you could take a few moments to review the WooCommerce 
   plugin using the link here: [https://wordpress.org/support/plugin/woocommerce/reviews/#new-post](https://wordpress.org/support/plugin/woocommerce/reviews/#new-post%C2%A0).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Additional checkout block fields – validation’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [block](https://wordpress.org/support/topic-tag/block/)
 * [checkout](https://wordpress.org/support/topic-tag/checkout/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * 2 replies
 * 3 participants
 * Last reply from: [LovingBro (woo-hc)](https://wordpress.org/support/users/lovingbro/)
 * Last activity: [10 months, 2 weeks ago](https://wordpress.org/support/topic/additional-checkout-block-fields-validation/#post-18573495)
 * Status: resolved