PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Dynamically Calculating Quantity

  1. I would like to change the quantity field on my product form based on the number of characters entered in a single line text field. I assume this would need to be done using javascript, Is there a "good" way to integrate that myself into a gravity form? Or should I just add a .js file to the header and go from there?

    Posted 12 years ago on Friday November 2, 2012 | Permalink
  2. You're right about using JavaScript, especially if you want it to happen on the page after the text is entered, and before the form is submitted.

    The correct way to include your script is the enqueue it, with the proper pre-requisite scripts, and only when necessary for this form. You can use the gform_enqueue_scripts filter:
    http://www.gravityhelp.com/documentation/page/Gform_enqueue_scripts

    If you need help implementing your script, let us know. Include a URL to the site if you have any trouble.

    Posted 12 years ago on Tuesday November 13, 2012 | Permalink