Support

Home Forums Event Espresso Premium Prefill Custom Question

Prefill Custom Question

Posted: July 30, 2014 at 4:06 pm

Viewing 2 reply threads


Gary Formisano

July 30, 2014 at 4:06 pm

Hello,

I’m trying to pre-fill a custom question on the registration page so that when a modified URL is posted, the content is displayed in the custom question.

Here is what I tried so far:
For example, we have added a new field, which EE3 assigns the name “TEXT_12”. When we tried to add “&TEXT_12=test” (no quotes) the registration page “domain.com/event-registration/?ee=5&TEXT_12=test”, nothing happened.

We tested this with other variables to such as appending “&fname=test”.

We did some research and found that WordPress does not allow for this sort of thing.. It has to be a registered query…. so I’m looking to register the query with get_query_var( ‘somevar’ );

sooo. I found in the registration_page_display.php a function called event_espresso_add_question_groups(..)… I feel like I’m getting warm. I found from another link in the forum that led me to find “insert_question.php” in /event-espresso/includes/admin-files/form-builder/questions/

So I believe that I need to edit / add something to this file to complete the task.

Again, I’m just trying to pre-fill a custom question on the registration page so that when a modified URL is posted, the content is displayed in the custom question.

Looking forward to your response.

Sincerely,
Gary Formisano


Dean

July 31, 2014 at 2:31 am

Hi,

Personally, I would go back to adding the &TEXT_12=test and use some jQuery.

A quick Google led me to this page http://stackoverflow.com/questions/19491336/get-url-parameter-jquery, which allowed me to add this jQuery to the bottom of the registration_page_display.php template:

https://gist.github.com/Apina/28ae505d313fb9bb435d

In the long run it will be easier to maintain this as it doesn’t involve messing with core files.


Gary Formisano

August 1, 2014 at 12:43 pm

Hi Dean,

Thanks for your suggestion! I spent a few hours perfecting the jQuery and now it works exactly how I needed.

Thanks again Dean!

Sincerely,
Gary Formisano

Viewing 2 reply threads

The support post ‘Prefill Custom Question’ 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