Events Made Easy › Forums › How do I … › Dynamic form field placeholder substitutions
- This topic has 11 replies, 2 voices, and was last updated 7 years ago by Anonymous.
-
AuthorPosts
-
Tue 7 Nov 2017 at 19:04 #56889AnonymousInactive
I want to use my booking form to collect extra data for each seat that is registered, so that I end up with Name/Email of every attendee in addition to the person who booked.
I have added the following recurrence:
#_SPACES greater than 1, Template X, Repeat Yes, Group 1In my form format I have added #_DYNAMICDATA between the end of the fields table and the submit button.
I have created a template called X type All, with the following content:
<table class='eme-rsvp-form'> <tr><th scope='row'>First Name*:</th><td>#REQ_FIRSTNAME</td></tr> <tr><th scope='row'>Last Name*:</th><td>#_LASTNAME</td></tr> <tr><th scope='row'>E-Mail*:</th><td>#_HTML5_EMAIL</td></tr> </table>
When I go to my form and increase the seats required beyond 1, I get duplicates of the template, but the placeholders are not substituted for form fields. They are just printed as text, e.g. ‘Last Name*: #_LASTNAME‘.
Am I approaching this completely the wrong way, or just missing some detail? I’ve trawled the docs and forums and still am not seeing it, so apologies if it is obvious.
P.S. loving the plugin so far!
Thanks
RichardTue 7 Nov 2017 at 19:42 #56890FrankyKeymasterYour logic is almost correct: you can ask for extrta info, but just not for “main info” (like #_LASTNAME etc ..). You can just ask for extra info for custom fields you created.
So create a field for extra lastnames, aother one for firstnames and call that one in your template (using #_FIELD{xx} syntax)Tue 7 Nov 2017 at 20:19 #56892AnonymousInactiveThanks for the speedy response. Just using custom fields does indeed fix the problem – the fields now appear correctly.
But when I submit data into the custom fields (either in the main part of the form, or the dynamic section) it seems to get ‘lost’. By that I mean:
1) I have #_FIELDS in my contact emails, and that prints just a blank line
2) If I go in to edit a pending registration, the fields appear blank. If I enter data and update, then go back in, the fields are again blank.
My custom fields are all just text fields, with no extra settings except that they are required fields.
Also these fields don’t appear as columns in the CSV or Printable View of the event.
Is there something extra I need to do to ‘associate’ the custom fields with the event or something like that?
Tue 7 Nov 2017 at 23:50 #56895FrankyKeymasterRead the doc on dynamic fields, #_FIELDS is not appropriate there, use #_DYNAMICDATA
But if you have problems with storing the data, it won’t show anything.
Check your logfiles first, maybe there’s some database problem …Wed 8 Nov 2017 at 12:39 #56898AnonymousInactiveNeither #_FIELDS nor #_DYNAMICDATA print anything. (I have custom fields in the non-dynamic section, which should presumably be printed via #_FIELDS).
I’m still working on getting log data – I don’t have access to the config files right now, and this is a live site so all the debug info is probably turned off.
Are the custom fields responses supposed to be written into the wp_eme_answers table? According to the database status in the dashboard, that table only ever has one record in it, so that would suggest it is failing to write.
I initially installed v2.0.0 of the plugin, before upgrading to v2.0.1. I saw the changelog about some tables not being created in 2.0.0. Is there anything else I need to do to rectify that besides updating the plugin?
Thanks
Wed 8 Nov 2017 at 12:59 #56899FrankyKeymasterIt should indeed appear in the answers table.
But 2.0.1 should be ok.
These are the columns you should have in that table:
answer_id int(11) NOT NULL,
booking_id mediumint(9) DEFAULT 0,
person_id mediumint(9) DEFAULT 0,
member_id mediumint(9) DEFAULT 0,
field_id int(11) DEFAULT 0,
answer text NOT NULL,
grouping int(11) DEFAULT 0,
occurence int(11) DEFAULT 0,Wed 8 Nov 2017 at 13:14 #56900AnonymousInactiveThe table structure looks correct from my sql dump.
If I empty the table it works for the first booking (for simplicity I now just have one custom field, and not dynamics). It’s as though the table can only have one record in it.
Wed 8 Nov 2017 at 13:28 #56901FrankyKeymasterThat would be rather impossible, but I’ll try a local fresh install of WP and EME
Wed 8 Nov 2017 at 13:51 #56902FrankyKeymasterThanks for insisting on this problem, and you’re correct: I forgot to add the auto_increment for new installations to the answer_id column (although currently I don’t need it …)
So I’ll add it again, otherwise indeed it will fail to add extra records. I’ll release an update today.Wed 8 Nov 2017 at 15:15 #56903AnonymousInactiveNo problem – as a developer myself I know every support case is some combination of user error and actual bug! Thanks a lot for the prompt responses.
Wed 8 Nov 2017 at 18:34 #56904FrankyKeymasterI just released a new version that should fix this.
Thu 9 Nov 2017 at 16:41 #56918AnonymousInactiveGreat thanks, looks to have fixed it, I’ll test more fully once I’ve finished my form.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.