<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: call javascript function upon validation error</title>
		<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error</link>
		<description>Gravity Support Forums Topic: call javascript function upon validation error</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 13:58:47 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/call-javascript-function-upon-validation-error" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "call javascript function upon validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error#post-74560</link>
			<pubDate>Sun, 09 Sep 2012 21:23:51 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">74560@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I believe the following will do the trick for you. Place it in your theme's function.php file.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;#39;gform_register_init_scripts&#38;#39;, &#38;#39;register_custom_init_script&#38;#39;, 10, 2);
function register_custom_init_script($form, $field_values){
    $script =  &#38;quot;info_scripts();&#38;quot;;
    GFFormDisplay::add_init_script($form[&#38;#39;id&#38;#39;], &#38;#39;my_custom_script&#38;#39;, GFFormDisplay::ON_PAGE_RENDER, $script);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Andre Macola on "call javascript function upon validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error#post-74270</link>
			<pubDate>Thu, 06 Sep 2012 18:31:01 +0000</pubDate>
			<dc:creator>Andre Macola</dc:creator>
			<guid isPermaLink="false">74270@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can see here: &#60;a href=&#34;http://maco.la/disbrave&#34; rel=&#34;nofollow&#34;&#62;http://maco.la/disbrave&#60;/a&#62; at footer. NEWSLETTER form&#60;/p&#62;
&#60;p&#62;I have a script that change the &#34;value&#34; for placeholder but after subimit with ajax, the form need to load the script again.&#60;/p&#62;
&#60;p&#62;I`ts the functions =&#38;gt; info_scripts();
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "call javascript function upon validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error#post-73953</link>
			<pubDate>Wed, 05 Sep 2012 06:34:35 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">73953@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Do you have a link to your form please?  Thanks
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Andre Macola on "call javascript function upon validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error#post-73925</link>
			<pubDate>Wed, 05 Sep 2012 03:51:39 +0000</pubDate>
			<dc:creator>Andre Macola</dc:creator>
			<guid isPermaLink="false">73925@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I have a similar problem. Need to Call a script after the Ajax loads the validation error. How I do that?&#60;/p&#62;
&#60;p&#62;The solution above only works with ajax off
&#60;/p&#62;</description>
		</item>
		<item>
			<title>edmire on "call javascript function upon validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error#post-16768</link>
			<pubDate>Fri, 21 Jan 2011 11:26:25 +0000</pubDate>
			<dc:creator>edmire</dc:creator>
			<guid isPermaLink="false">16768@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "call javascript function upon validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error#post-16766</link>
			<pubDate>Fri, 21 Jan 2011 11:18:11 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">16766@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Currently there is no javascript event that you can bind to for a validation error; however, what you can do is check for the existence of the validation error div which has the class &#34;.validation_error&#34;. If found, you'll know that you'll want to run your code.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
jQuery(document).ready(function(){

    if(jQuery(&#38;quot;div.validation_error&#38;quot;).length != 0){

        // code that should be run if the validation error exists goes here

    }

});
&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Double check that code as I just wrote it in this forum post on the fly. Should do the trick though.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>edmire on "call javascript function upon validation error"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/call-javascript-function-upon-validation-error#post-16742</link>
			<pubDate>Thu, 20 Jan 2011 22:54:00 +0000</pubDate>
			<dc:creator>edmire</dc:creator>
			<guid isPermaLink="false">16742@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is there anyway to call a javascript function upon validation error?&#60;/p&#62;
&#60;p&#62;Let's say I have a simple text field that is required. If I click Submit without populating the field, I get &#34;There was a problem with your submission.&#60;br /&#62;
Errors have been highlighted below&#34;.  It's great but I'd like to be able to call a javascript function in addition to displaying the error message.  What would be the best way to accomplish that?  Thanks.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
