Title: Trigger update_checkout without triggering form validation
Last modified: February 4, 2020

---

# Trigger update_checkout without triggering form validation

 *  Resolved [norabrown212](https://wordpress.org/support/users/norabrown212/)
 * (@norabrown212)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/trigger-update_checkout-without-triggering-form-validation/)
 * Hello,
 * My checkout page is in the following order:
    1. coupon form
    2. cart
    3. checkout form and payment fields etc.
 * I am doing a custom coupon submission to hook into an external API. On success,
   I call `$('body').trigger('update_checkout');` which causes the order review 
   area to update, showing coupon success messages as well as the updated cart totals—
   all good!
 * However, it also triggers the checkout form validation, so that all the form 
   fields show errors (having not been filled out when the customer submits the 
   coupon).
 * How can I either:
    - Cause only the order review area/cart to be updated
    - Call update_checkout without triggering form validation
 *  -  This topic was modified 6 years, 4 months ago by [norabrown212](https://wordpress.org/support/users/norabrown212/).

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

 *  Thread Starter [norabrown212](https://wordpress.org/support/users/norabrown212/)
 * (@norabrown212)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/trigger-update_checkout-without-triggering-form-validation/#post-12398386)
 * One further thing I noticed. Our custom coupon application code adds certain 
   notices using, for example `wc_add_notice( __( 'Coupon code applied successfully!','
   woocommerce' ), 'success' )`
 * But even a ‘success’ type notice causes the ‘result’ attribute of the `wc-ajax
   =update_order_review` call to be ‘failure’ and that is what seems to trigger 
   the form validation. If I remove all notices, that call returns `result: success`
   and the form validation errors don’t appear. But, the user also doesn’t see a
   message about coupon success or failure, so it’s not a good solution.
 *  [Mike W](https://wordpress.org/support/users/nixiack8/)
 * (@nixiack8)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/trigger-update_checkout-without-triggering-form-validation/#post-12489762)
 * Hi there,
 * This is a fairly complex development topic. I’m going to leave it open for a 
   bit to see if anyone is able to chime in to help you out.
    I can also recommend
   the following places for more development-oriented questions:
 * 1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
 * 2. Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.
   woocommerce/

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

The topic ‘Trigger update_checkout without triggering form 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

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

 * 2 replies
 * 2 participants
 * Last reply from: [Mike W](https://wordpress.org/support/users/nixiack8/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/trigger-update_checkout-without-triggering-form-validation/#post-12489762)
 * Status: resolved