<?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: Forcing a field to only accept registered usernames of a spesific role as input</title>
		<link>https://legacy.forums.gravityhelp.com/topic/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input</link>
		<description>Gravity Support Forums Topic: Forcing a field to only accept registered usernames of a spesific role as input</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 02:57:36 +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/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Forcing a field to only accept registered usernames of a spesific role as input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input#post-44952</link>
			<pubDate>Mon, 26 Dec 2011 20:14:56 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">44952@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I did something similar to this, verifying a 9 digit code from a file on the server.  You could do the same thing using the database instead of a file.  And instead of the code, you will verify the username, not the code.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastebin.com/7ANQh6Rc&#34; rel=&#34;nofollow&#34;&#62;http://pastebin.com/7ANQh6Rc&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Maybe that will spark some ideas.  I adapted that from something I did earlier that was pulling codes from the database, so I can find that for you if you're interested.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Forcing a field to only accept registered usernames of a spesific role as input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input#post-44950</link>
			<pubDate>Mon, 26 Dec 2011 20:11:07 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">44950@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;functions.php is fine in your theme folder.  There is little difference between a plugin and a function added to your theme's functions.php. &#60;/p&#62;
&#60;p&#62;You can make it easier on yourself to do this all in your theme's functions.php.  No need to copy any GF functionality.  Just extend the GF functionality by using the hooks to perform your username validation.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dimitris73 on "Forcing a field to only accept registered usernames of a spesific role as input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input#post-44888</link>
			<pubDate>Fri, 23 Dec 2011 11:37:16 +0000</pubDate>
			<dc:creator>Dimitris73</dc:creator>
			<guid isPermaLink="false">44888@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;OK, thank you. :)&#60;br /&#62;
I am new to hooks and custom plugins. So I would like some further advice.&#60;br /&#62;
1) Should I create a plugin for this or should I use my funcions.php?&#60;br /&#62;
2) I am also going to use hooks for other GF forms.  If I create a plugin, sould I make one that has all the custom funcionality regardig GF, or sould I make a seperate plugin for each form?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Forcing a field to only accept registered usernames of a spesific role as input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input#post-44860</link>
			<pubDate>Fri, 23 Dec 2011 00:10:03 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">44860@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You could do this with custom validation using the &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_validation&#34; rel=&#34;nofollow&#34;&#62;gform_validation&#60;/a&#62; hook.  You would populate the list of acceptable usernames (selected from your WordPress database using whatever criteria is important to you) and then compare the submitted username to the list of usernames.  If there is no match, return a validation error.  If there is a match, continue.&#60;/p&#62;
&#60;p&#62;1000 usernames can be returned from a MySQL database fairly quickly and the array functions in PHP are pretty fast, so I don't think this will be a problem.  You'll have to try it out and see and improve it as necessary. For example, instead of pulling all the names of a certain role, you could search the database for a match on the one username that was submitted in the form. No match means they get a validation error. Doing it this way would be no problem at all with 1000 records.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dimitris73 on "Forcing a field to only accept registered usernames of a spesific role as input"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/forcing-a-field-to-only-accept-registered-usernames-of-a-spesific-role-as-input#post-44777</link>
			<pubDate>Thu, 22 Dec 2011 02:04:20 +0000</pubDate>
			<dc:creator>Dimitris73</dc:creator>
			<guid isPermaLink="false">44777@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello&#60;br /&#62;
I have 2 questions.&#60;br /&#62;
1) Is there a way to force a field to only accept registered usernames of a spesific role as input? I could create an enormous multiselect and manually update it every time I get a new user of that role, but I was wondering whether the feild could be updated dynamicly.&#60;br /&#62;
2) Would this field have funcionality problems if there were, say, 1000 users of that role?&#60;br /&#62;
Question 2 is more important to me.&#60;br /&#62;
Thank you
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
