<?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: Quantity needs a valid number: but it is!</title>
		<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is</link>
		<description>Gravity Support Forums Topic: Quantity needs a valid number: but it is!</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 21:45:03 +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/quantity-needs-a-valid-number-but-it-is" rel="self" type="application/rss+xml" />

		<item>
			<title>stephencounsell on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-26267</link>
			<pubDate>Wed, 25 May 2011 03:29:23 +0000</pubDate>
			<dc:creator>stephencounsell</dc:creator>
			<guid isPermaLink="false">26267@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi&#60;br /&#62;
This post is almost what I need and I have it working on my form BUT...&#60;/p&#62;
&#60;p&#62;How can I pass a the $value variable to the function.&#60;br /&#62;
I want to use:&#60;br /&#62;
return GFCommon::to_money($value)&#60;/p&#62;
&#60;p&#62;I'm setting $value is a pre-form php case statement based on a GET (url) variable.&#60;br /&#62;
It all works fine IF is use:&#60;br /&#62;
return GFCommon::to_money(550)&#60;br /&#62;
and sets the form price to £550.00&#60;/p&#62;
&#60;p&#62;Thanks in advance&#60;br /&#62;
Steve
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24590</link>
			<pubDate>Sat, 30 Apr 2011 21:12:31 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">24590@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Interesting. It worked well on my local install. If you send me a WP login to &#60;a href=&#34;mailto:alex@rocketgenius.com&#34;&#62;alex@rocketgenius.com&#60;/a&#62;, I will be happy to take a closer look.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carlo on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24569</link>
			<pubDate>Sat, 30 Apr 2011 03:36:17 +0000</pubDate>
			<dc:creator>Carlo</dc:creator>
			<guid isPermaLink="false">24569@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you Alex, that was a doubt I had.&#60;br /&#62;
I changed the code but the form still says that I have to insert a valid number...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24525</link>
			<pubDate>Fri, 29 Apr 2011 13:26:06 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">24525@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You are very close. The validation is getting triggered by the price, not the quantity. The reason is that the price value needs to be currency formatted. See below&#60;/p&#62;
&#60;p&#62;Replace&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_prezzo&#38;quot;, &#38;quot;populate_prezzo&#38;quot;);
function populate_prezzo($value){
	return 550;
	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;With&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_prezzo&#38;quot;, &#38;quot;populate_prezzo&#38;quot;);
function populate_prezzo($value){
	return GFCommon::to_money(550);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Carlo on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24461</link>
			<pubDate>Thu, 28 Apr 2011 17:51:46 +0000</pubDate>
			<dc:creator>Carlo</dc:creator>
			<guid isPermaLink="false">24461@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;ok, here it is the page template i'm using for the form:&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/1845098&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/1845098&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;in the form edit, i checked  &#34;Allow field to be populated dynamically&#34; and i used:&#60;br /&#62;
Name: prodotto&#60;br /&#62;
Price	: prezzo&#60;br /&#62;
Quantity: quantita&#60;/p&#62;
&#60;p&#62;Note that i'm in phase 1: I inserted a value in the populate function.&#60;br /&#62;
I wanted to pass to phase 2 (dinamically pass a value depending on a post custom field) when phase 1 works.&#60;br /&#62;
Thank you very much!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24092</link>
			<pubDate>Mon, 25 Apr 2011 14:37:15 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">24092@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Okay, the issue is going to be how you are dynamically populating the field(s).  Can you post your custom code so we can take a look? Use &#60;a href=&#34;http://pastie.org&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org&#60;/a&#62; and post a link to the code snippet.&#60;/p&#62;
&#60;p&#62;The way the Pricing Fields work is it checks the values against what the form is setup to use to insure users aren't tampering with the values.  Depending on how your custom code was written, it's going to trigger this and think it's been tampered with.  It's a security measure.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carlo on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24089</link>
			<pubDate>Mon, 25 Apr 2011 13:53:57 +0000</pubDate>
			<dc:creator>Carlo</dc:creator>
			<guid isPermaLink="false">24089@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes I am. I have several products but I need one form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24068</link>
			<pubDate>Mon, 25 Apr 2011 11:21:02 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">24068@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Are you using PHP and custom code to dynamically populate form data?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carlo on "Quantity needs a valid number: but it is!"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/quantity-needs-a-valid-number-but-it-is#post-24024</link>
			<pubDate>Sun, 24 Apr 2011 02:22:49 +0000</pubDate>
			<dc:creator>Carlo</dc:creator>
			<guid isPermaLink="false">24024@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, I've setup all the plugin and it goes to PayPal correctly (I'm still in sandbox mode now). The problem is with the product field. I have dinamically populated name and price and it seems ok.&#60;br /&#62;
In the form, as test user, I insert the quantity and submit: the form tells that I need to insert a valid value! If i submit again (without changing the value) it works. How could it be?? Thanks!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
