Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

G74un3 on "[Plugin: Contact Form 7] Calling javascript function on validation"

$
0
0

This seems like a simple problem but for some reason i haven't been able to find any solution.

I have placed my contact form in a div tag that is just big enough to have room for all of the input elements. Then I want the div to expand when to make room for the error messenges generated when a user submits input that does not pass validation.

I have written a javascript function to get the div to expand and it works perectly. Then I called the function from an onclick event which I placed in a div element warpped around the submit button. This solution seems to work but my problem is that when a user clicks the button, Contact Form 7 refreshes the page and therefore the div goes back to its originale size defined by CSS.

So I am thinking that I need to find a way to call my javascript function after the page has been refreshed. Maybe along with the validation. I know of the on_sent_ok hook but haven't been able to find anything similar for when a user clicks the button but no email is send.

Does anybody have any idears on how to achieve this?

Thank you in advance :)

http://wordpress.org/plugins/contact-form-7/


Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>