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.

Run Javascript on conditional form update

  1. Hello,

    I have a theme which runs the equal heights jQuery plugin to make the sidebar look nice. However, whenever I dynamically change the length of the content, I have to run the javascript call again to even things up.

    I'd love to be able to slip a line of javascript into the conditional form update to run the equal heights update and make things look nice.

    Is there a way (a hook, possibly?) to add an on_click function to a field in the form (I'm using a checkbox field).

    Thanks!

    - Jonathan

    Posted 11 years ago on Monday October 15, 2012 | Permalink
  2. Do you have a link to the page where your form is embedded?

    What do you mean by "conditional form update"? Do you mean that the length of the form changes when you click a field with conditional logic, and you want to update the length of the sidebar when that happens?

    Posted 11 years ago on Tuesday October 16, 2012 | Permalink
  3. Yep, exactly! Unfortunately, the form is for logged in users only--I could clone the form to something that I could show you, if you need to see it.

    - Jonathan

    Posted 11 years ago on Wednesday October 17, 2012 | Permalink
  4. Hello Jonathan,
    What you could do is add an HTML field to your form and add the Javascript code to bind to the gform_post_conditional_logic hook. The following snippet should point you in the right direction.

    http://pastie.org/5078791

    Posted 11 years ago on Thursday October 18, 2012 | Permalink