Title: inline error in checkout fields
Last modified: August 5, 2019

---

# inline error in checkout fields

 *  Resolved [dexter303](https://wordpress.org/support/users/dexter303/)
 * (@dexter303)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/inline-errors-in-checkout-fields/)
 * Hi, good day!
 * how can I show the required fields error in checkout as inline error?
 * [https://businessbloomer.com/woocommerce-display-required-field-errors-inline-checkout/](https://businessbloomer.com/woocommerce-display-required-field-errors-inline-checkout/)
 * I tried the solution in this website but it only works for the name and last 
   name field.
 * regards,
    dexter
    -  This topic was modified 6 years, 10 months ago by [dexter303](https://wordpress.org/support/users/dexter303/).

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

 *  [prasenjitjsr](https://wordpress.org/support/users/prasenjitjsr/)
 * (@prasenjitjsr)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/inline-errors-in-checkout-fields/#post-11847553)
 * Update your PHP code:
 *     ```
       add_filter( 'woocommerce_form_field', 'checkout_fields_in_label_error', 10, 4 );
   
       function checkout_fields_in_label_error( $field, $key, $args, $value ) {
          if ( strpos( $field, '</span>' ) !== false && $args['required'] ) {
             $error = '<span class="error" style="display:none">';
             $error .= sprintf( __( '%s is a required field.', 'woocommerce' ), $args['label'] );
             $error .= '</span>';
             $field = substr_replace( $field, $error, strpos( $field, '</span>' ), 0);
          }
          return $field;
       }
       ```
   
 *  Thread Starter [dexter303](https://wordpress.org/support/users/dexter303/)
 * (@dexter303)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/inline-errors-in-checkout-fields/#post-11852684)
 * Awesome! It works. Thank you 🙂
 * Best regards,
    Dexter
 *  [smiranda](https://wordpress.org/support/users/smiranda/)
 * (@smiranda)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/inline-errors-in-checkout-fields/#post-12050996)
 * This code has no effect on my site. Woocommerce up to date. Tokoo theme not using
   it’s own template. Garyfong.com

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

The topic ‘inline error in checkout fields’ 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/)

 * 3 replies
 * 3 participants
 * Last reply from: [smiranda](https://wordpress.org/support/users/smiranda/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/inline-errors-in-checkout-fields/#post-12050996)
 * Status: resolved