<?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: Prevent negative number in calculation</title>
		<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation</link>
		<description>Gravity Support Forums Topic: Prevent negative number in calculation</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 17:09:34 +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/prevent-negative-number-in-calculation" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-144190</link>
			<pubDate>Thu, 07 Feb 2013 11:29:12 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">144190@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the update Trevor.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Trevor on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-143717</link>
			<pubDate>Wed, 06 Feb 2013 20:31:22 +0000</pubDate>
			<dc:creator>Trevor</dc:creator>
			<guid isPermaLink="false">143717@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes, all good for now thank you. Cheers.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-143691</link>
			<pubDate>Wed, 06 Feb 2013 20:03:24 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">143691@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Are you all sorted out now?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Trevor on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-143089</link>
			<pubDate>Wed, 06 Feb 2013 03:51:11 +0000</pubDate>
			<dc:creator>Trevor</dc:creator>
			<guid isPermaLink="false">143089@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;UPDATE - fixed. code ain't pretty but it works. Thank anyhow.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Trevor on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-142027</link>
			<pubDate>Tue, 05 Feb 2013 00:19:38 +0000</pubDate>
			<dc:creator>Trevor</dc:creator>
			<guid isPermaLink="false">142027@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Currently the bulk of my scripts, including this one, are in my scripts.js file:&#60;br /&#62;
&#60;a href=&#34;http://dei.calypsocomhost.com/wp-content/themes/imaging/library/js/scripts.js&#34; rel=&#34;nofollow&#34;&#62;http://dei.calypsocomhost.com/wp-content/themes/imaging/library/js/scripts.js&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-142024</link>
			<pubDate>Tue, 05 Feb 2013 00:14:52 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">142024@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Did you add your calculations to an external script, or should they be visible in the source of the page? I could not find them.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Trevor on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-141511</link>
			<pubDate>Mon, 04 Feb 2013 11:04:24 +0000</pubDate>
			<dc:creator>Trevor</dc:creator>
			<guid isPermaLink="false">141511@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes, it's at the same place as before... &#60;a href=&#34;http://dei.calypsocomhost.com/form/&#34; rel=&#34;nofollow&#34;&#62;http://dei.calypsocomhost.com/form/&#60;/a&#62; &#60;/p&#62;
&#60;p&#62;Thanks! And good to know the character stripping is needed...I figured.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-141324</link>
			<pubDate>Mon, 04 Feb 2013 08:11:42 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">141324@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you don't want to do string comparisons and want to just compare numbers (and perform math on the numbers), then you will need to strip out any of those extraneous characters, as you have done with the dollar sign.&#60;/p&#62;
&#60;p&#62;Do you have a link to a page where this is in practice now, so we can take a look at how the JavaScript is working with the page?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Trevor on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-141088</link>
			<pubDate>Mon, 04 Feb 2013 03:57:16 +0000</pubDate>
			<dc:creator>Trevor</dc:creator>
			<guid isPermaLink="false">141088@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Excellent! Once I get the script sorted I can embed it with this -- thanks! Unfortunately I'm having a heck of a time actually getting my script to change the value. I'm also having trouble comparing the values as they are strings not integers. Do I have to strip out all the other characters &#34;.&#34; and &#34;,&#34;  - I've just started by striping the &#34;$&#34; but didn't go further as I wasn't sure if this was the right way to go.&#60;/p&#62;
&#60;p&#62;My main issue though is I can't seem to change the value of total. In the code below I just have it trying to replace it with &#34;123&#34;. Ultimately I would just add the deductible back into the total if condition below is true.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$(&#38;quot;#gform_next_button_2_4&#38;quot;).click(function(){
        var deductible = $(&#38;quot;#input_2_12&#38;quot;).val().replace(&#38;#39;$&#38;#39;, &#38;#39;&#38;#39;);
        var total = $(&#38;quot;#ginput_base_price_2_6&#38;quot;).val().replace(&#38;#39;$&#38;#39;, &#38;#39;&#38;#39;);
        if ((deductible) &#38;gt;= (total)) {
            $(&#38;quot;#ginput_base_price_2_6&#38;quot;).val(&#38;#39;123&#38;#39;);
            $(&#38;quot;#input_2_6&#38;quot;).val(&#38;#39;123&#38;#39;);
        }
    });&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I know this is above and beyond, but if you have a few moments to look at this awesome. If not, no worries!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Prevent negative number in calculation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/prevent-negative-number-in-calculation#post-140830</link>
			<pubDate>Sun, 03 Feb 2013 23:37:01 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">140830@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;To add jQuery to your Gravity Form, you can enter it into an HTML field in the form, or you can add it to the head section of the page where the form is embedded.  If you want to add it to the head section of the  page, you can use the gform_enqueue_scripts filter:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_enqueue_scripts&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_enqueue_scripts&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The script you write will be pretty simple. It will watch for the inputs and then perform your calculation and populate another field with the result.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
