<?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: New RIB (IBAN similary) field type, problem form save/prepopulate_field_setting</title>
		<link>https://legacy.forums.gravityhelp.com/topic/new-rib-iban-similary-field-type-problem-form-saveprepopulate_field_setting</link>
		<description>Gravity Support Forums Topic: New RIB (IBAN similary) field type, problem form save/prepopulate_field_setting</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 22:20:50 +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/new-rib-iban-similary-field-type-problem-form-saveprepopulate_field_setting" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "New RIB (IBAN similary) field type, problem form save/prepopulate_field_setting"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/new-rib-iban-similary-field-type-problem-form-saveprepopulate_field_setting#post-161184</link>
			<pubDate>Tue, 05 Mar 2013 14:05:11 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">161184@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I see that you also opened a priority support ticket, so I will close this and we will focus the support there.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Wilhem Arnoldy on "New RIB (IBAN similary) field type, problem form save/prepopulate_field_setting"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/new-rib-iban-similary-field-type-problem-form-saveprepopulate_field_setting#post-159718</link>
			<pubDate>Mon, 04 Mar 2013 05:16:09 +0000</pubDate>
			<dc:creator>Wilhem Arnoldy</dc:creator>
			<guid isPermaLink="false">159718@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;We need to create RIB field. Concat of 4 fields. So, we use prepopulate_field_setting to get labels fields.&#60;/p&#62;
&#60;p&#62;I miss something, I don't see 4 field by js.php by one alone.&#60;br /&#62;
When i save, the fields are note recorded.&#60;br /&#62;
I think there is an array or something else to describe my fields but i don't see how?&#60;/p&#62;
&#60;p&#62;Could you help me?&#60;/p&#62;
&#60;p&#62;Thank you,&#60;br /&#62;
Justin.&#60;/p&#62;
&#60;p&#62;our code:&#60;br /&#62;
&#60;hr /&#62;&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php
/*
&#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;
*/

global $rib_fields;
$rib_fields = array(
	array(
		&#38;#39;title&#38;#39;=&#38;gt;&#38;#39;Code établissement&#38;#39;,
		&#38;#39;size&#38;#39;=&#38;gt;&#38;#39;5&#38;#39;,
		&#38;#39;label&#38;#39;=&#38;gt;&#38;#39;bank_code&#38;#39;,
	),
	array(
		&#38;#39;title&#38;#39;=&#38;gt;&#38;#39;Code guichet&#38;#39;,
		&#38;#39;size&#38;#39;=&#38;gt;&#38;#39;5&#38;#39;,
		&#38;#39;label&#38;#39;=&#38;gt;&#38;#39;sort_code&#38;#39;,
	),
	array(
		&#38;#39;title&#38;#39;=&#38;gt;&#38;#39;Numéro de compte&#38;#39;,
		&#38;#39;size&#38;#39;=&#38;gt;&#38;#39;11&#38;#39;,
		&#38;#39;label&#38;#39;=&#38;gt;&#38;#39;account_number&#38;#39;,
	),
	array(
		&#38;#39;title&#38;#39;=&#38;gt;&#38;#39;Clé RIB&#38;#39;,
		&#38;#39;size&#38;#39;=&#38;gt;&#38;#39;2&#38;#39;,
		&#38;#39;label&#38;#39;=&#38;gt;&#38;#39;key&#38;#39;,
	),
);

class gravityforms_fields_addons {
	public function __construct($master) {
		$this-&#38;gt;master = $master;
	}

	public function init() {
		// Add a custom field button to the advanced to the field editor
		add_filter( &#38;#39;gform_add_field_buttons&#38;#39;, &#38;#39;wps_add_rib_field&#38;#39; );
		function wps_add_rib_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;RIB&#38;quot;, &#38;quot;gravityforms&#38;quot;),
						&#38;quot;onclick&#38;quot; =&#38;gt; &#38;quot;StartAddField(&#38;#39;rib&#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;wps_rib_title&#38;#39; );
		function wps_rib_title( $type ) {
			if ( $type == &#38;#39;rib&#38;#39; )
				return __( &#38;#39;RIB&#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;wps_rib_field_input&#38;quot;, 10, 5 );
		function wps_rib_field_input ( $input, $field, $value, $lead_id, $form_id ){
			global $rib_fields;
			if ( $field[&#38;quot;type&#38;quot;] == &#38;quot;rib&#38;quot; ) {
				$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();
				$css = isset( $field[&#38;#39;cssClass&#38;#39;] ) ? $field[&#38;#39;cssClass&#38;#39;] : &#38;#39;&#38;#39;;
				$output = &#38;quot;&#38;lt;div class=&#38;#39;ginput_container&#38;#39;&#38;gt;&#38;quot;;
				foreach($rib_fields as $idx =&#38;gt; $f) {
					$output .= sprintf(&#38;quot;&#38;lt;span style=&#38;#39;float: left; padding-right: 20px;&#38;#39;&#38;gt;&#38;lt;label style=&#38;#39;display: block;&#38;#39;&#38;gt;%s&#38;lt;/label&#38;gt;&#38;lt;input name=&#38;#39;input_%s&#38;#39; id=&#38;#39;%s&#38;#39; class=&#38;#39;input gform_rib %s&#38;#39; $tabindex size=&#38;#39;%s&#38;#39; maxlength=&#38;#39;%s&#38;#39; value=&#38;#39;%s&#38;#39;&#38;gt;&#38;lt;/span&#38;gt;{$max_chars}&#38;quot;, $f[&#38;#39;title&#38;#39;], $field[&#38;quot;id&#38;quot;].&#38;quot;.&#38;quot;.$idx, &#38;#39;input_&#38;#39;.$field[&#38;#39;id&#38;#39;].&#38;#39;_&#38;#39;.$idx, $field[&#38;quot;type&#38;quot;] . &#38;#39; &#38;#39; . esc_attr( $css ), $f[&#38;#39;size&#38;#39;] + 1,$f[&#38;#39;size&#38;#39;], esc_html($value));
				}
				$output .= &#38;quot;&#38;lt;/div&#38;gt;&#38;quot;;
				return $output;
			}

			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($) {
				fieldSettings[&#38;quot;rib&#38;quot;] = &#38;quot;.label_setting, .description_setting, .admin_label_setting, .size_setting, .error_message_setting, .css_class_setting, .visibility_setting, .rib_setting, .prepopulate_field_setting&#38;quot;;

				//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_rib&#38;quot;).attr(&#38;quot;checked&#38;quot;, field[&#38;quot;field_rib&#38;quot;] == true);
					$(&#38;quot;#field_rib_value&#38;quot;).val(field[&#38;quot;rib&#38;quot;]);
				});
			});

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

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

			// Create settings on position 50 (right after Field Label)
			if( $position == 50 ){

			}
		}

	}
}

?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
