<?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: passing form variables to function</title>
		<link>https://legacy.forums.gravityhelp.com/topic/passing-form-variables-to-function</link>
		<description>Gravity Support Forums Topic: passing form variables to function</description>
		<language>en-US</language>
		<pubDate>Thu, 23 Apr 2026 07:08:26 +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/passing-form-variables-to-function" rel="self" type="application/rss+xml" />

		<item>
			<title>adomedia on "passing form variables to function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/passing-form-variables-to-function#post-37177</link>
			<pubDate>Wed, 05 Oct 2011 18:10:57 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">37177@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks David, I'll give that a go
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "passing form variables to function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/passing-form-variables-to-function#post-37176</link>
			<pubDate>Wed, 05 Oct 2011 18:01:29 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">37176@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Tom,&#60;/p&#62;
&#60;p&#62;You are correct for checkboxes.&#60;/p&#62;
&#60;p&#62;For radio buttons, there is a single value submitted for the field (not per input) so you can check it like so:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
if($entry[21] == &#38;#39;yes&#38;#39;) {
    // execute &#38;#39;yes&#38;#39; code
} else {
    // execute &#38;#39;no&#38;#39; code
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>adomedia on "passing form variables to function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/passing-form-variables-to-function#post-37114</link>
			<pubDate>Wed, 05 Oct 2011 13:40:38 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">37114@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;br /&#62;
I need to pass the variables from a massive form to a function that will register a post type with a considerable amount of custom fields etc.&#60;/p&#62;
&#60;p&#62;What I need to know...&#60;br /&#62;
A: How to detect if a checkbox is ticked after form submission etc. I have the following code&#60;br /&#62;
if($entry['22.1']) {&#60;br /&#62;
add_post_meta($post_id,'customfield','value');&#60;br /&#62;
}&#60;br /&#62;
Will this work? Does it need to have a value in the if statement or will the $entry element be empty if not checked?&#60;/p&#62;
&#60;p&#62;B: How to detect the values of a radio group with 'yes' or 'no' answers and do the same thing as above. Again do I need to put in a value if statement and how would I do that? What is the structure of the $entry element on a radio group? Is it $entry['21.2'] or $entry['21_2']?&#60;br /&#62;
Im guessing if there are two answers then&#60;br /&#62;
yes = $entry['21.1'] or $entry['21_1']&#60;br /&#62;
no = $entry['21.2'] or $entry['21_2']&#60;/p&#62;
&#60;p&#62;Thanks in advance for the help guys and keep up the good work, this plugin is seriously spectacular and worth every penny!!!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
