Title: Price Rules setting creates JavaScript error
Last modified: November 16, 2018

---

# Price Rules setting creates JavaScript error

 *  [matthewasibe](https://wordpress.org/support/users/matthewasibe/)
 * (@matthewasibe)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/price-rules-setting-creates-javascript-error/)
 * Hey again,
 * Sorry to keep blowing you up. I plan on using this plugin pretty extensively 
   in my shop, so we might get to know each other well.
 * I have a nice form at the link I posted, and turned on the Price Rules -> Update
   Price? setting for the real-time price updates. Everything else set to Default
   or Hide.
 * This creates the following JavaScript error and makes the WCFF form act funny
   on the page. When I turn off the Update Price? setting, everything goes back 
   to normal.
 * Uncaught RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous
   >) at Function.fa.matchesSelector (jquery.js?ver=1.12.4:2) at a.fn.init.closest(
   jquery.js?ver=1.12.4:2) at HTMLSelectElement.<anonymous> ((index):491) at HTMLDocument.
   dispatch (jquery.js?ver=1.12.4:3) at HTMLDocument.r.handle (jquery.js?ver=1.12.4:
   3) at Object.trigger (jquery.js?ver=1.12.4:3) at Object.a.event.trigger (jquery-
   migrate.min.js?ver=1.4.1:2) at HTMLSelectElement.<anonymous> (jquery.js?ver=1.12.4:
   3) at Function.each (jquery.js?ver=1.12.4:2)
 * I really love what I’ve seen so far. Keep up the good work!!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fprice-rules-setting-creates-javascript-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [mjbehrii](https://wordpress.org/support/users/mjbehrii/)
 * (@mjbehrii)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/price-rules-setting-creates-javascript-error/#post-10960328)
 * Did this ever get fixed?
 * It works for me when there’s no Field Rules.
 *  Thread Starter [matthewasibe](https://wordpress.org/support/users/matthewasibe/)
 * (@matthewasibe)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/price-rules-setting-creates-javascript-error/#post-10960375)
 * Not fixed. Thanks for the further info.
 * My fields do contain field rules.
 *  Thread Starter [matthewasibe](https://wordpress.org/support/users/matthewasibe/)
 * (@matthewasibe)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/price-rules-setting-creates-javascript-error/#post-10997985)
 * Please help. Making a push to get the site live this week.
 *  Thread Starter [matthewasibe](https://wordpress.org/support/users/matthewasibe/)
 * (@matthewasibe)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/price-rules-setting-creates-javascript-error/#post-11003083)
 * Further testing shows:
    - I am able to successfully show and hide fields one by one, but this error 
      occurs each time.
    - The Javascript attempts to hide all fields on page load. It crashes on the
      first one, leaving all the others exposed.
    - The price never updates
 * I looked up the error that we are getting. It seems that one of your recursive
   functions has a base case that cannot be met.
 * I would guess that this error is occurring when a field is updated after the 
   conditional fields are shown or hidden. Maybe where the price is supposed to 
   be updated. Once it throws the error, the rest of the Javascript on the page 
   stops.
 * Trying to help as much as possible. I need to push this site live this week, 
   and this would be a key feature for what we are offering customers.
 * Please help. Thanks in advance!
 *  Thread Starter [matthewasibe](https://wordpress.org/support/users/matthewasibe/)
 * (@matthewasibe)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/price-rules-setting-creates-javascript-error/#post-11007454)
 * Alright, well, I’ve waited over a month for a reply. I’m moving on.

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

The topic ‘Price Rules setting creates JavaScript error’ 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/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [update](https://wordpress.org/support/topic-tag/update/)

 * 5 replies
 * 2 participants
 * Last reply from: [matthewasibe](https://wordpress.org/support/users/matthewasibe/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/price-rules-setting-creates-javascript-error/#post-11007454)
 * Status: not resolved