Title: Conditional Logic Formula
Last modified: October 21, 2021

---

# Conditional Logic Formula

 *  [shawnm1](https://wordpress.org/support/users/shawnm1/)
 * (@shawnm1)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/conditional-logic-formula/)
 * I have a text field with value “011”
 * That is evaluated by: new RegExp(/^([0-9]{3})$/).test($$field_rnField90$$) ==
   false
    i.e. = this field should be invalid when the value doesn’t match the regex
   test
 * The value “011” returns false in smartforms, but returns true in a plain javascript
   file on my local machine.
 * The value “111” returns true as expected.
 * Therefore, smartforms is not evaluating this regex properly, as it seems to be
   dropping leading zeros, despite being a text field.
 * Please advise.

The topic ‘Conditional Logic Formula’ is closed to new replies.

 * ![](https://ps.w.org/smart-forms/assets/icon-256x256.jpg?rev=1226707)
 * [Smart Forms - when you need more than just a contact form](https://wordpress.org/plugins/smart-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-forms/reviews/)

## Tags

 * [conditional logic](https://wordpress.org/support/topic-tag/conditional-logic/)

 * 0 replies
 * 1 participant
 * Last reply from: [shawnm1](https://wordpress.org/support/users/shawnm1/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/conditional-logic-formula/)
 * Status: not resolved