<?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: Querying External Dataset to Validate Number Input</title>
		<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input</link>
		<description>Gravity Support Forums Topic: Querying External Dataset to Validate Number Input</description>
		<language>en-US</language>
		<pubDate>Mon, 06 Apr 2026 01:39:06 +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/querying-external-dataset-to-validate-number-input" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-74949</link>
			<pubDate>Wed, 12 Sep 2012 09:17:48 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">74949@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I emailed the actual code to Grant, but posted a generic version of the code here for anyone interested in this: &#60;a href=&#34;http://pastebin.com/8LaYuDZs&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/8LaYuDZs&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-73815</link>
			<pubDate>Tue, 04 Sep 2012 12:46:53 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">73815@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Please export your form, send your CSV, and your functions.php via email to &#60;a href=&#34;mailto:chris@rocketgenius.com&#34;&#62;chris@rocketgenius.com&#60;/a&#62; and I will have a crack at it..  Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Grant Bivens on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-73784</link>
			<pubDate>Tue, 04 Sep 2012 10:42:16 +0000</pubDate>
			<dc:creator>Grant Bivens</dc:creator>
			<guid isPermaLink="false">73784@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm still having issues with getting this working properly. I really need to get this working as it's for registration of an event that is in November.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Grant
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Grant Bivens on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-72265</link>
			<pubDate>Thu, 23 Aug 2012 10:04:10 +0000</pubDate>
			<dc:creator>Grant Bivens</dc:creator>
			<guid isPermaLink="false">72265@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Chris,&#60;/p&#62;
&#60;p&#62;Thanks for your reply. I've changed the ID as you described above. My 'ID' in this case won't change as that function will always be looking at just that ID of the first array value which is the first column in a text file. Anyway that did fix that issue.&#60;/p&#62;
&#60;p&#62;You were right about the other issue with only passing one parameter in the first function. I'm a little confused on that. I think the &#34;$_POST['input_1']&#34; should be &#34;$thiscode&#34; in my is_code_valid function. I added the first two paramaters to the function call on line 8 but now it just validates false every time. I'm sure I'm just not connecting the dots properly.&#60;/p&#62;
&#60;p&#62;Here is what things look like now: &#60;a href=&#34;http://pastebin.com/UjxrLe4g&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/UjxrLe4g&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Grant
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-71636</link>
			<pubDate>Sun, 19 Aug 2012 21:41:08 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">71636@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Are you still looking for help with this one?  The topic was lost for a little while.&#60;/p&#62;
&#60;p&#62;The error on line 69 is because you are sending a constant, not a variable, to the function (the 'ID' part.)  There's usually no reason to do that, as there is no reason to send something that does not change in the function call.  That's why the error is thrown.  You can do something like this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
$id = &#38;#39;ID&#38;#39;;
function is_code_valid($csvdata, $id, $thiscode) {&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That would make the error go away, but I don't think it will make this work.&#60;/p&#62;
&#60;p&#62;On line 9 you call the function is_code_valid, with one parameter.  However, on line 69, your function is using three parameters.  There is probably a misunderstanding of some sort with that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Grant Bivens on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-69958</link>
			<pubDate>Tue, 07 Aug 2012 15:32:17 +0000</pubDate>
			<dc:creator>Grant Bivens</dc:creator>
			<guid isPermaLink="false">69958@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Still wrestling with this... anybody have an insight to my error I'm getting?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Grant Bivens on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-69222</link>
			<pubDate>Thu, 02 Aug 2012 16:28:57 +0000</pubDate>
			<dc:creator>Grant Bivens</dc:creator>
			<guid isPermaLink="false">69222@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ok, I'm getting close I think in merging the two scripts. I've got a pastie with what I've got so far here: &#60;a href=&#34;http://pastie.org/4379729&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/4379729&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I'm getting an error on line 69:&#60;/p&#62;
&#60;p&#62;&#34;Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '&#38;amp;' or T_VARIABLE in /home/ok/public_html/wp-content/themes/twentyten/functions.php on line 69&#34;&#60;/p&#62;
&#60;p&#62;Am I missing something on how I'm passing those variables from Gravity Forms to this function?&#60;/p&#62;
&#60;p&#62;My data set still looks like this: &#60;a href=&#34;http://pastie.org/4367213&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/4367213&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I haven't gotten there yet but I'm wondering if the query string will still work as well. What does the $lead array look like? Will I need to change that to look at my $csvdata array instead? I'll be wanting to pass all the values of the array for the matched ID. Meaning in my example data set I'll want to pass the ID, Name, and Town.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
GB
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Grant Bivens on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-68823</link>
			<pubDate>Tue, 31 Jul 2012 16:38:43 +0000</pubDate>
			<dc:creator>Grant Bivens</dc:creator>
			<guid isPermaLink="false">68823@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Chris,&#60;/p&#62;
&#60;p&#62;This definitely helps out a ton! I've got the code you supplied working on my form(s). I'm trying to expand it a little bit by using a csv file instead of just a list of IDs in a single column. Here is an &#60;a href=&#34;http://pastie.org/4367213&#34; rel=&#34;nofollow&#34;&#62;example of my dataset&#60;/a&#62;.&#60;/p&#62;
&#60;p&#62;I've got a script that I've stolen from php.net which splits this data from my text file into an array for each row and &#60;a href=&#34;http://pastie.org/4367216&#34; rel=&#34;nofollow&#34;&#62;looks like this&#60;/a&#62;.&#60;/p&#62;
&#60;p&#62;The output of that script against my data &#60;a href=&#34;http://pastie.org/4367225&#34; rel=&#34;nofollow&#34;&#62;looks like this&#60;/a&#62;.&#60;/p&#62;
&#60;p&#62;Is there any way you could help me marry your function with this csv to array script so it just searches the id's and the returns the three values within the matching ID's array as query strings?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
GB
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-68154</link>
			<pubDate>Thu, 26 Jul 2012 23:12:12 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">68154@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Here is a good discussion regarding that:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/database-look-up-validation&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/database-look-up-validation&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I created a text file with 2000 numbers in it.  Take a look at that and see if you get any ideas or need any help with that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Grant Bivens on "Querying External Dataset to Validate Number Input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/querying-external-dataset-to-validate-number-input#post-68113</link>
			<pubDate>Thu, 26 Jul 2012 18:01:30 +0000</pubDate>
			<dc:creator>Grant Bivens</dc:creator>
			<guid isPermaLink="false">68113@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm done some searching around the form and I'm just throwing this out there to see if anybody has any good ideas before I start doing anything with this. Here is the scenario:&#60;/p&#62;
&#60;p&#62;1. I have a form where users have to enter their ID number.&#60;br /&#62;
2. I have a dataset that matches those ID numbers with their address.&#60;br /&#62;
3. I need to validate that the ID they enter is in fact an actual ID and not made up.&#60;br /&#62;
4. I also need to display their address on the screen below the ID field so they can make sure they input their ID correctly.&#60;/p&#62;
&#60;p&#62;My dataset that I need to validate against is quite large (1,818 IDs). They are a 7 digit number that all start with 0 and range from 0071264 to 0584684 and are obviously not consecutive numbers (that really doesn't matter too much I suppose). I can put this dataset wherever I need to, in the WP database, csv or text file on the server, etc...&#60;/p&#62;
&#60;p&#62;The ID number is the first thing they enter on the form and I need it to validate after they enter in their ID (not upon form submission).&#60;/p&#62;
&#60;p&#62;I also have the form setup to redirect back to itself with half of the form being filled in automatically via query strings from the initial submission. The reason for this is users will be submitting the form anywhere from 1-10 times to register each person in their group. I realize that will require the form to revalidate the ID number when the form loads again after redirection and the fields are filled in via query strings.&#60;/p&#62;
&#60;p&#62;So if you have any insight or if you've seen anybody do anything similar to this and wouldn't mind giving me a push start that would be awesome. Any other suggestions would be welcomed.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
GB
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
