Forum Replies Created
-
AuthorPosts
-
dannhanksMember
Hi, I cant get ANY custom fields to pre-load into the fields. I am guessing this is to do with the odd name it gives the fields when adding custom fields…
It would be easier if we tried to tackle an easier part of the form which I need to load.
So, I have added a custom text field “address line 2”
When filling in the registration form it gives me the output of:
<input type=”text” name=”emember_custom[address-line-2]” class=”vfb-text vfb-medium” id=”vfb-address-line-2-29″ value=””>
… so I add this to my functions.php file:
add_filter(‘gform_field_value_add2’, ‘custom_populate_add2’);
function custom_populate_add2($value){
if(wp_emember_is_member_logged_in()){
$emember_auth = Emember_Auth::getInstance();
$value= $emember_auth->getUserInfo(’emember_custom[address-line-2]’);
return $value;
}
}
and in my gravity forms I set the “Allow field to be populated dynamically” Parameter name to: emember_custom[address-line-2]
… it doesnt load.
If I add a pre-defined field from the form builder, I can retrieve and populate the field but as soon as its a custom one it adds the name in a weird format such as: name=”emember_custom[field-name]”
… I am guessing its having trouble with the odd format that adding a custom field seems to do when naming the field?
Any help would be great… Thanks!
dannhanksMemberhello, can you offer any advice on the above? thanks!
dannhanksMemberHi, I have tried several combinations of this and I cant get it to work.
On my form this is the code for the custom field:
<select id=”vfb-title-9″ class=”vfb-text vfb-medium valid” name=”emember_custom[title]”><option value=”Mr”>Mr</option>
<option value=”Mrs”>Mrs</option>
<option value=”Miss”>Miss</option>
<option value=”Ms”>Ms</option>
<option value=”Dr”>Dr</option>
<option value=”Prof”>Prof</option>
<option value=”Rev”>Rev</option>
<option value=”Br”>Br</option>
<option value=”Sr”>Sr</option>
</select>
… which I assume means I should be referencing: “emember_custom[title]” as the custom field name.
I have tried both:
$emember_auth = Emember_Auth::getInstance();
$value = $emember_auth->getUserInfo(“emember_custom[title]”);
and
$emember_auth = Emember_Auth::getInstance();
$value = $emember_auth->getUserInfo(“title”);
while referencing my parameter name as both “emember_custom[title]” and “title” in my gravity form.
I cant get any of it to work.
It seems I am able to get any of the pre built functions from the form builder such as phone or street address but as soon as I use a custom one, the name field appears as emember_custom[thetitle] , I guess it’s this that’s causing the issue?
I hope there is a way around this.
thanks for your help!
Dann
dannhanksMemberhi, any updates?
dannhanksMemberHi, thanks yes that will work for me, the full list of items which my client was after included:
Rev
Prof
Br
Sr
… there are a few other custom fields I need here too. Will I be able to pull this information through to the gravity form if I use emember’s custom fields?
thanks..
Dann
-
AuthorPosts