<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: Feature Request:  Custom javascript hooks on a per form basis</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: Feature Request:  Custom javascript hooks on a per form basis</description>
<language>en</language>
<pubDate>Mon, 04 May 2026 01:30:23 +0000</pubDate>

<item>
<title>yuniar on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-21719</link>
<pubDate>Mon, 08 Sep 2014 06:13:38 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">21719@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Sorry it took so long for this to get implemented. We've completed this for v4.2. We expect to release v4.2 before the end of this month.
&#60;/p&#62;</description>
</item>
<item>
<title>jere2329 on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-21672</link>
<pubDate>Fri, 29 Aug 2014 14:53:30 +0000</pubDate>
<dc:creator>jere2329</dc:creator>
<guid isPermaLink="false">21672@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Bumping - any updates?
&#60;/p&#62;</description>
</item>
<item>
<title>jere2329 on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-20519</link>
<pubDate>Tue, 25 Mar 2014 04:17:22 +0000</pubDate>
<dc:creator>jere2329</dc:creator>
<guid isPermaLink="false">20519@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Are there any updates on this?
&#60;/p&#62;</description>
</item>
<item>
<title>Paul-T on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-19642</link>
<pubDate>Wed, 13 Nov 2013 03:38:38 +0000</pubDate>
<dc:creator>Paul-T</dc:creator>
<guid isPermaLink="false">19642@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Just realized, in the second if statement, I did not close the clause. Please use it like so:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;if($&#38;#39;#form_10943&#38;#39;).length) {
    // Do something for form_10943
    }&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Example: &#60;a href=&#34;http://jsfiddle.net/tutmeister/8rBpz/7/&#34; rel=&#34;nofollow&#34;&#62;http://jsfiddle.net/tutmeister/8rBpz/7/&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>Paul-T on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-19641</link>
<pubDate>Wed, 13 Nov 2013 02:30:01 +0000</pubDate>
<dc:creator>Paul-T</dc:creator>
<guid isPermaLink="false">19641@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I approached this a different way, and it seems to work so far. &#60;/p&#62;
&#60;p&#62;I have included a custom.js file in the &#38;lt;head&#38;gt;, which for me is around line 5020 in view-functions.php using MachForm 3.5. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;script type=&#38;quot;text/javascript&#38;quot; src=&#38;quot;{$machform_Path}custom.js&#38;quot;&#38;gt;&#38;lt;/script&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This JavaScript file is therefore called by all forms and can target individual forms by checking whether the form ID exists. If it does, it runs the function for that form. You can have multiple form IDs in separate if statements; therefore, this can work as a custom JavaScript for as many forms as you would like. The change function below adds up six number and displays it in a disabled input (element_81).&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$(document).ready(function () {

    var one, two, three, four, five, six, total;
    // JavaScript for form_10942
    if ($(&#38;#39;#form_10942&#38;#39;).length) {

        $(&#38;#39;#element_81&#38;#39;).prop(&#38;#39;disabled&#38;#39;, true);
        $(document).change(function () {
            one     = $(&#38;#39;#element_75&#38;#39;).val();
            two     = $(&#38;#39;#element_76&#38;#39;).val();
            three   = $(&#38;#39;#element_77&#38;#39;).val();
            four    = $(&#38;#39;#element_78&#38;#39;).val();
            five    = $(&#38;#39;#element_79&#38;#39;).val();
            six     = $(&#38;#39;#element_80&#38;#39;).val();
            total   = parseFloat(one) + parseFloat(two) + parseFloat(three) + parseFloat(four) + parseFloat(five) + parseFloat(six);
            $(&#38;#39;#element_81&#38;#39;).val(parseFloat(total).toFixed(2));
        });
    }
    if($&#38;#39;#form_10943&#38;#39;).length {
    // Do something for form_10943
    }
});&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>rodp on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-19303</link>
<pubDate>Sat, 05 Oct 2013 02:36:13 +0000</pubDate>
<dc:creator>rodp</dc:creator>
<guid isPermaLink="false">19303@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Hi -- just to let you know, we've had some success placing Javascript directly in the form description field. Not ideal -- would be better to add it to the &#38;lt;head&#38;gt; section, but it did let us modify some behaviours on the fly.&#60;/p&#62;
&#60;p&#62;Cheers&#60;br /&#62;
Rod
&#60;/p&#62;</description>
</item>
<item>
<title>jere2329 on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-17801</link>
<pubDate>Thu, 28 Mar 2013 07:16:20 +0000</pubDate>
<dc:creator>jere2329</dc:creator>
<guid isPermaLink="false">17801@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Any progress on this? I'd love custom javascript as I said in my email;)
&#60;/p&#62;</description>
</item>
<item>
<title>yuniar on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-15880</link>
<pubDate>Wed, 05 Sep 2012 23:03:05 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">15880@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;I agree that we should have a way to implement custom javascript for each form. We're putting this into our todo list.
&#60;/p&#62;</description>
</item>
<item>
<title>nationjob on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-15866</link>
<pubDate>Wed, 05 Sep 2012 03:10:13 +0000</pubDate>
<dc:creator>nationjob</dc:creator>
<guid isPermaLink="false">15866@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;This might make sense in the template part instead of the form itself.  That way we could set up specific templates with the common code we want,
&#60;/p&#62;</description>
</item>
<item>
<title>nationjob on "Feature Request:  Custom javascript hooks on a per form basis"</title>
<link>https://www.machform.com/forums/topic/feature-request-custom-javascript-hooks-on-a-per-form-basis#post-15863</link>
<pubDate>Wed, 05 Sep 2012 03:01:15 +0000</pubDate>
<dc:creator>nationjob</dc:creator>
<guid isPermaLink="false">15863@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;We would REALLY like to be able to push our own javascript into each form.  This would help us GREATLY in doing odd things with the form client side.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
