- This topic has 7 replies, 2 voices, and was last updated 6 years, 11 months ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › … insert value with php in eme_formfields.php in dynamic Formfields?
… Hello, I have a members plugin with custom fields, whose contents I have to enter in the custom fields of eme. Now I have seen that one could enter the contents by value in the fixed fields. But how do I get the value of the dynamically generated fields?
Sincerley
jfreakr
That’s outside the scope of EME, but you need to start by examining $_POST when entering a member. I’ll add an action hook for new members in the next version, so you can work based on that info.
Thanks for your answer.
Thank you for your reply. I have to do that somehow.
In eme.formfields.php I added the following lines at about 1038:
$ bookerPhone = get_user_meta ($ current_user-> ID, ‘phone1’, true);
$ bookerFax = get_user_meta ($ current_user-> ID, ‘fax’, true);
in about 1445 the phone is entered in the form:
$ replacement = “<input $ required_att type = ‘tel’ name = ‘$ fieldname’ value = ‘$ bookerPhone’ $ dynamic_field_class />”;
But the fax is a dynamic field. Do you have any idea how I get the member data in the value
Or better, how can I pass the value hidden with the member data and hide the form.
Ok, type = hidden is ok…. But I need a possibility to give the dynamic fields a $replacement string to add the value into it….
Or can i put hidden Inputs with name=”FIELDxx” and the Value into the Code? Better Idea?
$fax = eme_get_formfield("Fax");
if($fax) {$fax["field_values"] = $bookerFax;} else {echo 'Das hat nicht geklappt!';}
echo '<pre>';
var_dump($fax);
echo '</pre>';
I’m stuck here … The value in the array is changed, but that does not affect the form. I urgently need to get the dynamically generated fields (which I saved in a variable) into the value of the dynamically generated fields … Please Help
Ok, I did it. Thank you for your patience…
Sorry, but I’ve been busy with other bugs, daily work and end-of-year preparations …
Good you got it to work. The action hook eme_insert_member_action is in the latest version now and also documented.