<?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: Custom Form Field With Multiple Inputs</title>
		<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs</link>
		<description>Gravity Support Forums Topic: Custom Form Field With Multiple Inputs</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 16:12:32 +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/custom-form-field-with-multiple-inputs" rel="self" type="application/rss+xml" />

		<item>
			<title>marcel.ambiente on "Custom Form Field With Multiple Inputs"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs#post-273572</link>
			<pubDate>Fri, 24 May 2013 12:34:45 +0000</pubDate>
			<dc:creator>marcel.ambiente</dc:creator>
			<guid isPermaLink="false">273572@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Friend, there's an error at line 11, instead &#34;onclick&#34; =&#38;gt; &#34;StartAddField('add_loc'), put onclick&#34; =&#38;gt; &#34;StartAddField('addloc'); without the underline character at &#34;addloc&#34;... Obviously, all &#34;add_loc&#34; reference (type) will not work, so I suggest you to substitute every &#34;add_loc&#34; therm to &#34;addloc&#34;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Travis on "Custom Form Field With Multiple Inputs"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs#post-56164</link>
			<pubDate>Mon, 23 Apr 2012 09:29:05 +0000</pubDate>
			<dc:creator>Travis</dc:creator>
			<guid isPermaLink="false">56164@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Did you ever make progress on this?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>swimtime on "Custom Form Field With Multiple Inputs"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs#post-45325</link>
			<pubDate>Tue, 03 Jan 2012 03:29:58 +0000</pubDate>
			<dc:creator>swimtime</dc:creator>
			<guid isPermaLink="false">45325@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Unfortunately, this post was closed, &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/extending-gravityform&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/extending-gravityform&#60;/a&#62;, and it no longer open to replies. The above example from WPSmith is a good start, but it does not explain how to create an Advanced Field type with more than one element as I described in my previous comment. Any further examples/insight would be more than helpful.&#60;/p&#62;
&#60;p&#62;Additionally, as a feature request, the ability to create/edit an XML document that contained definitions of your Advanced Field types would be hightly beneficial because then people could create/edit their own Advanced Field types without having to become highly familiar with PHP and JQuery and the nuances of the internals of Gravity Forms. This would allow users to apply limitless combinations of form types to Gravity Forms and extend it's usefulness.&#60;/p&#62;
&#60;p&#62;Best...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>swimtime on "Custom Form Field With Multiple Inputs"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs#post-45324</link>
			<pubDate>Tue, 03 Jan 2012 03:11:51 +0000</pubDate>
			<dc:creator>swimtime</dc:creator>
			<guid isPermaLink="false">45324@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I, too, would be interested in the steps necessary to correctly create and integrate my own *custom* Advanced Fields into Gravity Forms.&#60;/p&#62;
&#60;p&#62;The *custom* Advanced Field would contain the following elements: Firstname, Lastname, 2 input fields, birthdate, days-of-the-week single-select drop-down, and time. Then would like to be able to create conditional checkbox(s) that would display/hide instances of this object.&#60;/p&#62;
&#60;p&#62;Any feedback or tutorials would be great. So far, the only example I can find is this posting and from WPSmith, &#60;a href=&#34;http://wpsmith.net/2011/plugins/how-to-create-a-custom-form-field-in-gravity-forms-with-a-terms-of-service-form-field-example/&#34; rel=&#34;nofollow&#34;&#62;http://wpsmith.net/2011/plugins/how-to-create-a-custom-form-field-in-gravity-forms-with-a-terms-of-service-form-field-example/&#60;/a&#62;.&#60;/p&#62;
&#60;p&#62;Best...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thinkluke on "Custom Form Field With Multiple Inputs"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs#post-45316</link>
			<pubDate>Mon, 02 Jan 2012 23:47:12 +0000</pubDate>
			<dc:creator>thinkluke</dc:creator>
			<guid isPermaLink="false">45316@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;HI Chris,&#60;/p&#62;
&#60;p&#62;Thanks for your reply,&#60;br /&#62;
yeah that is exactly what is happening.&#60;/p&#62;
&#60;p&#62;It displays fine in the browser, but doesn't seem to pass the information to the entries layout in the admin.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Custom Form Field With Multiple Inputs"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs#post-45295</link>
			<pubDate>Mon, 02 Jan 2012 20:21:31 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">45295@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Explain what you mean that it works on the client side, not the server side.  What does that mean?  Is the display of the submitted data missing from the entry view?&#60;/p&#62;
&#60;p&#62;Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>thinkluke on "Custom Form Field With Multiple Inputs"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/custom-form-field-with-multiple-inputs#post-45266</link>
			<pubDate>Mon, 02 Jan 2012 02:37:44 +0000</pubDate>
			<dc:creator>thinkluke</dc:creator>
			<guid isPermaLink="false">45266@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I am trying to create a form that gets the latitude and longitude from Google maps and saves it to a custom table in WordPress. &#60;/p&#62;
&#60;p&#62;Currently i have created a the required fields and everything populates as expected.&#60;/p&#62;
&#60;p&#62;I have then added a custom field type to gravity forms. This renders fine on the client side however doesn't appear to be working on the server side as it is not sending the values through to gravity forms... i would like the function to display as the name field displays in entries.&#60;/p&#62;
&#60;p&#62;I am hoping you maybe able to let me know where i am going wrong &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Add a custom field button to the advanced to the field editor
add_filter( &#38;#39;gform_add_field_buttons&#38;#39;, &#38;#39;add_loc_field&#38;#39; );
function add_loc_field( $field_groups ) {
    foreach( $field_groups as &#38;amp;$group ){
        //if( $group[&#38;quot;name&#38;quot;] == &#38;quot;advanced_fields&#38;quot; ){ // to add to the Advanced Fields
        //if( $group[&#38;quot;name&#38;quot;] == &#38;quot;standard_fields&#38;quot; ){ // to add to the Standard Fields
        if( $group[&#38;quot;name&#38;quot;] == &#38;quot;post_fields&#38;quot; ){ // to add to the Standard Fields
            $group[&#38;quot;fields&#38;quot;][] = array(
                &#38;quot;class&#38;quot;=&#38;gt;&#38;quot;button&#38;quot;,
                &#38;quot;value&#38;quot; =&#38;gt; __(&#38;quot;Add Location&#38;quot;, &#38;quot;gravityforms&#38;quot;),
                &#38;quot;onclick&#38;quot; =&#38;gt; &#38;quot;StartAddField(&#38;#39;add_loc&#38;#39;);&#38;quot;
            );
            break;
        }
    }
    return $field_groups;
}

// Adds title to GF custom field
add_filter( &#38;#39;gform_field_type_title&#38;#39; , &#38;#39;add_loc_title&#38;#39; );
function add_loc_title( $type ) {
    if ( $type == &#38;#39;add_loc&#38;#39; )
	echo $field[&#38;quot;type&#38;quot;];
        return __( &#38;#39;Add Location&#38;#39; , &#38;#39;gravityforms&#38;#39; );
}

// Adds the input area to the external side
add_action( &#38;quot;gform_field_input&#38;quot; , &#38;quot;add_loc_field_input&#38;quot;, 10, 5 );
function add_loc_field_input ( $input, $field, $value, $lead_id, $form_id ){

    if ( $field[&#38;quot;type&#38;quot;] == &#38;quot;add_loc&#38;quot; ) {

		$value = array (

		);
        $max_chars = &#38;quot;&#38;quot;;
        if(!IS_ADMIN &#38;amp;&#38;amp; !empty($field[&#38;quot;maxLength&#38;quot;]) &#38;amp;&#38;amp; is_numeric($field[&#38;quot;maxLength&#38;quot;]))
            $max_chars = self::get_counter_script($form_id, $field_id, $field[&#38;quot;maxLength&#38;quot;]);

        $input_name = $form_id .&#38;#39;_&#38;#39; . $field[&#38;quot;id&#38;quot;];
        $tabindex = GFCommon::get_tabindex();

		//div start
		$wrap_start = sprintf(&#38;quot;&#38;lt;div id=&#38;#39;gmaps_location_%s&#38;#39; class=&#38;#39;ginput_complex ginput_container&#38;#39;&#38;gt;&#38;quot;,$field[&#38;quot;id&#38;quot;]);

		//Location - Address
		$location_address = sprintf(&#38;quot;&#38;lt;input type=&#38;#39;text&#38;#39; name=&#38;#39;input_%d_address&#38;#39; id=&#38;#39;%s_address&#38;#39;/&#38;gt;&#38;lt;label for=&#38;#39;add_loc_&#38;quot; . $field[&#38;quot;id&#38;quot;] . &#38;quot;_address&#38;#39; id=&#38;#39;add_loc_&#38;quot; . $field[&#38;quot;id&#38;quot;] . &#38;quot;_address_label&#38;#39;&#38;gt;Enter Location&#38;lt;/label&#38;gt;&#38;quot;	, $field[&#38;quot;id&#38;quot;], &#38;#39;add_loc_&#38;#39;.$field[&#38;#39;id&#38;#39;], $location_value, $disabled_text, $field_id);

		//Submit Location
		$sub_id = &#38;quot;add_loc_&#38;quot;.$field[&#38;#39;id&#38;#39;].&#38;quot;_address&#38;quot;;
		$sub_location = &#38;quot;&#38;lt;input type=\&#38;quot;button\&#38;quot; onclick=\&#38;quot;findAddress(document.getElementById(&#38;#39;{$sub_id}&#38;#39;).value);\&#38;quot;  value=\&#38;quot;Set Address on Map\&#38;quot; class=\&#38;quot;b_submit\&#38;quot;&#38;gt;&#38;quot;;

		$location_submit = $sub_location;

		//Map Canvas
		$map_canvas = &#38;quot;&#38;lt;div id=&#38;#39;map_canvas&#38;#39; style=&#38;#39;width:500px; height:500px&#38;#39;&#38;gt;&#38;lt;/div&#38;gt;&#38;quot;;	

		//Lat Position
		$lat_position = sprintf(&#38;quot;&#38;lt;input type=&#38;#39;text&#38;#39; name=&#38;#39;input_%d_lat&#38;#39; id=&#38;#39;%s_lat&#38;#39; value=&#38;#39;%F&#38;#39; $tabindex %s/&#38;gt;&#38;lt;label for=&#38;#39;add_loc_&#38;quot; . $field[&#38;quot;id&#38;quot;] . &#38;quot;_lat&#38;#39; id=&#38;#39;add_loc_&#38;quot; . $field[&#38;quot;id&#38;quot;] . &#38;quot;_lat_label&#38;#39;&#38;gt;Latitude&#38;lt;/label&#38;gt;&#38;quot;, $field[&#38;quot;id&#38;quot;], &#38;#39;add_loc_&#38;#39;.$field[&#38;#39;id&#38;#39;], esc_attr(stripslashes($geo_latitude)), $disabled_text, $field_id);

		//Lon Position
		$lon_position = sprintf(&#38;quot;&#38;lt;input type=&#38;#39;text&#38;#39; name=&#38;#39;input_%d_lon&#38;#39; id=&#38;#39;%s_lon&#38;#39; value=&#38;#39;%F&#38;#39; $tabindex %s/&#38;gt;&#38;lt;label for=&#38;#39;add_loc_&#38;quot; . $field[&#38;quot;id&#38;quot;] . &#38;quot;_lon&#38;#39; id=&#38;#39;add_loc_&#38;quot; . $field[&#38;quot;id&#38;quot;] . &#38;quot;_lon_label&#38;#39;&#38;gt;Longitude&#38;lt;/label&#38;gt;&#38;quot;, $field[&#38;quot;id&#38;quot;], &#38;#39;add_loc_&#38;#39;.$field[&#38;#39;id&#38;#39;], esc_attr(stripslashes($geo_longitude)), $disabled_text, $field_id);

		//end div
		$wrap_end = &#38;quot;&#38;lt;/div&#38;gt;&#38;quot;;

		$multifield = $wrap_start;
		$multifield .= $location_address;
		$multifield .= $location_submit;
		$multifield .= $map_canvas;
		$multifield .= $lat_position;
		$multifield .= $lon_position;
		$multifield .= print_r($value);
		$multifield .= $wrap_end;

		//$multifield = sprintf(&#38;quot;&#38;lt;div class=&#38;#39;ginput_container&#38;#39;&#38;gt;&#38;lt;input type= &#38;#39;text&#38;#39; name=&#38;#39;input_%s_address&#38;#39; id=&#38;#39;%s_address&#38;#39; class=&#38;#39;textfield gform_add_loc %s&#38;#39; value=&#38;#39;%s&#38;#39; /&#38;gt;&#38;lt;/div&#38;gt;&#38;quot;, $field[&#38;quot;id&#38;quot;], &#38;#39;add_loc-&#38;#39;.$field[&#38;#39;id&#38;#39;] , $field[&#38;quot;type&#38;quot;] . &#38;#39; &#38;#39; . esc_attr($field[&#38;#39;cssClass&#38;#39;]) . &#38;#39; &#38;#39; . $field[&#38;#39;size&#38;#39;] , esc_attr(stripslashes($value)));

		 return $multifield;

    }

    return $input;
}

// Now we execute some javascript technicalitites for the field to load correctly
add_action( &#38;quot;gform_editor_js&#38;quot;, &#38;quot;wps_gform_editor_js&#38;quot; );
function wps_gform_editor_js(){
?&#38;gt;

&#38;lt;script type=&#38;#39;text/javascript&#38;#39;&#38;gt;

    jQuery(document).ready(function($) {
        //Add all textarea settings to the &#38;quot;add_loc&#38;quot; field plus custom &#38;quot;add_loc_setting&#38;quot;
        // fieldSettings[&#38;quot;add_loc&#38;quot;] = fieldSettings[&#38;quot;textarea&#38;quot;] + &#38;quot;, .add_loc_setting&#38;quot;; // this will show all fields that Paragraph Text field shows plus my custom setting

        // from forms.js; can add custom &#38;quot;add_loc_setting&#38;quot; as well
        fieldSettings[&#38;quot;add_loc&#38;quot;] = &#38;quot;.label_setting, .description_setting, .admin_label_setting, .size_setting, .default_value_textarea_setting, .error_message_setting, .css_class_setting, .visibility_setting, .add_loc_setting&#38;quot;; //this will show all the fields of the Paragraph Text field minus a couple that I didn&#38;#39;t want to appear.

        //binding to the load field settings event to initialize the checkbox
        $(document).bind(&#38;quot;gform_load_field_settings&#38;quot;, function(event, field, form){
            jQuery(&#38;quot;#field_add_loc&#38;quot;).attr(&#38;quot;checked&#38;quot;, field[&#38;quot;field_add_loc&#38;quot;] == true);
            $(&#38;quot;#field_add_loc_value&#38;quot;).val(field[&#38;quot;add_loc&#38;quot;]);
        });
    });

&#38;lt;/script&#38;gt;
&#38;lt;?php
}

// Add a custom setting to the add_loc advanced field
add_action( &#38;quot;gform_field_advanced_settings&#38;quot; , &#38;quot;add_loc_settings&#38;quot; , 10, 2 );
function add_loc_settings( $position, $form_id ){

    // Create settings on position 50 (right after Field Label)
    if( $position == 50 ){
    ?&#38;gt;

    &#38;lt;li class=&#38;quot;add_loc_setting field_setting&#38;quot;&#38;gt;

        &#38;lt;input type=&#38;quot;checkbox&#38;quot; id=&#38;quot;field_add_loc&#38;quot; onclick=&#38;quot;SetFieldProperty(&#38;#39;field_add_loc&#38;#39;, this.checked);&#38;quot; /&#38;gt;
        &#38;lt;label for=&#38;quot;field_add_loc&#38;quot; class=&#38;quot;inline&#38;quot;&#38;gt;
            &#38;lt;?php _e(&#38;quot;Disable Submit Button&#38;quot;, &#38;quot;gravityforms&#38;quot;); ?&#38;gt;
            &#38;lt;?php gform_tooltip(&#38;quot;form_field_add_loc&#38;quot;); ?&#38;gt;
        &#38;lt;/label&#38;gt;

    &#38;lt;/li&#38;gt;
    &#38;lt;?php
    }
}

//Filter to add a new tooltip
add_filter(&#38;#39;gform_tooltips&#38;#39;, &#38;#39;wps_add_add_loc_tooltips&#38;#39;);
function wps_add_add_loc_tooltips($tooltips){
   $tooltips[&#38;quot;form_field_add_loc&#38;quot;] = &#38;quot;&#38;lt;h6&#38;gt;Disable Submit Button&#38;lt;/h6&#38;gt;Check the box if you would like to disable the submit button.&#38;quot;;
   $tooltips[&#38;quot;form_field_default_value&#38;quot;] = &#38;quot;&#38;lt;h6&#38;gt;Default Value&#38;lt;/h6&#38;gt;Enter the Add Location here.&#38;quot;;
   return $tooltips;
}

// Add a script to the display of the particular form only if add_loc field is being used
add_action( &#38;#39;gform_enqueue_scripts&#38;#39; , &#38;#39;wps_gform_enqueue_scripts&#38;#39; , 10 , 2 );
function wps_gform_enqueue_scripts( $form, $ajax ) {
    // cycle through fields to see if add_loc is being used
    foreach ( $form[&#38;#39;fields&#38;#39;] as $field ) {
        if ( $field[&#38;#39;type&#38;#39;] == &#38;#39;add_loc&#38;#39; ) {
			wp_register_script( &#38;#39;gmaps_api&#38;#39;, &#38;#39;http://maps.googleapis.com/maps/api/js?sensor=true&#38;#39;);
    		wp_enqueue_script( &#38;#39;gmaps_api&#38;#39; );
            break;
        }
    }
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
