Support

Home Forums Event Espresso Premium How to pre-populate a field with value of another field

How to pre-populate a field with value of another field

Posted: January 3, 2013 at 12:05 pm


Adelaide

January 3, 2013 at 12:05 pm

I want to use the attendee’s name (first and last) to populate another registration field, and allow the attendee to modify that field. Like populating a billing address with previously supplied ship-to address. How to do that?


Dean

January 4, 2013 at 12:47 am

Hello Adelaide,

Currently the onsite payment gateways will populate the forms with the attendee data that the user inserts, depending on what questions have been asked (ie if the address isnt requested, it wont get populated, but if it is requested it will).

If you have data saved elsewhere you can easily amend the payment gateway template and add PHP to call that data and echo it in the form fields value section.

example from the AIM gateway template

<input name="first_name" type="text" id="aim_first_name" value="<?php echo $fname ?>" />

So really it depends on what data you are trying to insert and where.


Adelaide

January 4, 2013 at 6:42 am

Hi Dean. I was using the the question about populating a billing address with ship-to address as an example. Specifically, what I want to do is to use attendee first and last name to populate the name-tag field. We ask for registrants to supply their name as they want it to be printed on their name tag, and I want to pre-populate that field with the first and last names (and possibly salutation and job title) that they supply on the form.

Thanks for your help.


Dean

January 4, 2013 at 8:34 am

Hi,

OK, I had a feeling you might be edging towards that aspect. Right now no it isnt possible without customising aspects of the core plugin which we don’t really recommend. This is due to the way the custom questions are created dynamically.

We have earmarked this as a feature to be added, and there is a ticket in place to add this feature to the WP User Integration (Members) addon but due to a shift in focus onto version 3.2 I cannot advise when this will be made.


Adelaide

January 4, 2013 at 9:26 am

So does this mean that I also couldn’t style different custom questions differently? Basically there’s no way to target individual custom questions?


Dean

January 4, 2013 at 9:41 am

Hi,

No, styling is still very easy to do, each question group has a unique identifier so the whole group and the labels etc can be targeted with CSS.


Adelaide

January 4, 2013 at 10:57 am

Yes, I see that now. Thanks again for your help.

The support post ‘How to pre-populate a field with value of another field’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso