Title: Custom Validation
Last modified: March 4, 2018

---

# Custom Validation

 *  [heteregroup](https://wordpress.org/support/users/heteregroup/)
 * (@heteregroup)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-validation-14/)
 * Hi,
 * I would like to validate an input field created with this plugin before adding
   to cart.
 * For example I have a field “username” and would like to check if entered value
   is an username stored in my DB. I already did an API function to check if the
   username already exist in my db table but I don’t know how to connect the function
   to the custom field.
 * Can you please let me know how to do this?
 * Thanks

Viewing 1 replies (of 1 total)

 *  [sarkparanjothi](https://wordpress.org/support/users/sarkparanjothi/)
 * (@sarkparanjothi)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-validation-14/#post-10055695)
 * Add css class each field using javascript (ajax) send custom field value to api
   and validate response if it is failed throw error message.

Viewing 1 replies (of 1 total)

The topic ‘Custom Validation’ is closed to new replies.

 * ![](https://ps.w.org/wc-fields-factory/assets/icon-128x128.jpg?rev=2738843)
 * [WC Fields Factory](https://wordpress.org/plugins/wc-fields-factory/)
 * [Support Threads](https://wordpress.org/support/plugin/wc-fields-factory/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-fields-factory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-fields-factory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-fields-factory/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [sarkparanjothi](https://wordpress.org/support/users/sarkparanjothi/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/custom-validation-14/#post-10055695)
 * Status: not resolved