Forums

Add Event Title To Form Automatically

nweirens 07 Mar, 2013
Is there a setting for automatically displaying the event title on a form? So the customer knows what event they are registering for and so us (the organization) know what they registered for. There are too many events to make a single form for each one, and I hope there is a way to pull the event title and display it on the the form. Thanks!
GreyHead 08 Mar, 2013
Hi nweirens,

Where does the Event Title come from?

Bob
nweirens 08 Mar, 2013
It would be coming from the Jevents Calendar event pages. I would like to have each event title from the event page show up on the form (registration form). Is that possible?
Thank you!!
GreyHead 08 Mar, 2013
Hi nweirens,

I expect so, how do you get the title from JEvents? I don't know anything about that part.

Have you searched the forums here? There have been some other posts about JEvents but I don't remember if they answered this question.

Bob
nweirens 08 Mar, 2013
Yes, I been searching for a while. I just need to know how to have the chronoform pull a title from a page and display it on the form so people know what they are filling out. I know I could make a new form for each event, but that is seriously time consuming. I know this is possible, but I cant figure it out.
GreyHead 08 Mar, 2013
Hi nweirens,

Can you identify the event from the page URL? If you can do that you can probably look up the title in a database table.

Bob
nweirens 11 Mar, 2013
Sure, you can identify the event from the URL...so what do you do to get the event title to show up on the form?
GreyHead 11 Mar, 2013
Hi mweirens,

Add a Custom Code action to the form On Load event with a MySQL query to look up the event title from the JEvents tables - should be a snippet something like:
<?php
$db =& JFactory::getDBO();
$query = "
    SELECT `title`
        FROM `#__jevents`
        WHERE `event_id` = '{$form->data['event_id']}' ;
";
$db->setQuery($query);
$form->data['event_title'] = $db->loadResult();
?>

I made all the table, column and parameter names up so you'll need to check what the real names are.

Bob
FloB 13 Mar, 2013
Hello!
I'm using JEvents too.
For me, the URL of the page of an event finish like that:
yyyy/mm/dd/event_id/109%7C116/summary_seo

With
yyyy, mm, dd : the dtstart of the event
event_id : the id number of the event (evdet_id of the table #_jevents_vevdetail I think)
109%7C116 : I don't know what is that, I've got it for each event of my calendar
summary_seo : the summary of the event where all spaces and non alpha num character are replaced by "-"
So you just have to get the event_id and make a DB record loader to find all the information you want about the event (table #_jevents_vevdetail), or in a easier way, get the information of the event directly in the url.

It's a form I'd probably make one day, when I'll have some time...
nweirens 13 Mar, 2013
I can't seem to make it work.

Here is the form I want to use:
http://symsolutions.com/j256/index.php/event-registration

Here is an example of one of the events, titles, date and time I would like to appear on the registration form:
http://symsolutions.com/j256/index.php/free-hands-on-test-drive/icalrepeat.detail/2013/04/30/2/-/simulation-hands-on-test-drive

Do your steps you described allow me to use the same form for all events (and make no changes to it), but the forms date and title will change based on what event they are registering for??
GreyHead 13 Mar, 2013
Hi nweirens ,

I don't see anything on the example page you posted that lets me identify the event :-(

Maybe it's possible to work it out from the URL but I don't know where the info is. Is there anything in the JEvent docs that helps?

Bob
GreyHead 13 Mar, 2013
Hi mweirens,

Unfortunately computers aren't that good at reading text from a page and getting it right :-(

What you are looking for here is something on the page that will let ChronoForms identify the event uniquely and accurately. There is some information in the page URL
free-hands-on-test-drive/icalrepeat.detail/2013/04/30/2/-/simulation-hands-on-test-drive
but I don't know if that is enough to identify the event, it looks as though this is a repeating event so the ID structure may be different from FloB's URL which included an event URL.

I have checked the page HTML to see if there is an identified in a div id that could be looked up, as far as I can see there isn't.

Back to my previous post . . . how can you identify the event to ChronoForms?

Bob
FloB 13 Mar, 2013
As I say here is the finish of your url:
2013/04/30/2/-/simulation-hands-on-test-drive
yyyy=2013
mm=04
dd=30
id number of the event = 2 (I suppose, up to you to confirm)
- = I still don't know what it is
simulation-hands-on-test-drive = for Simulation Hands-on Test Drive, the summary of the event (I forgot to say that your text is set to lower character too)

So if you can have the url from where the form is posted, then you can have the informations of your event.
So 1 form for as many as you want events.

Another way to register is to have a form with a drop down linked to the table "_jevents_vevdetail".

Edit : See this FAQ (http://www.chronoengine.com/faqs/2631-how-can-i-get-information-about-the-current-page.html) to get the url of the page. Your form must be in the description of the event, using the tags {chronoform} or in a module which appears in the page of your event.

Edit for you Bob : JEvents permit to have repeated events, so you have a principal table #_jevents_vevent that list the events you created (with an id number, a category number and an detail event id number...but no informations about the dates or what describe the event) and there is another table #_jevents_vevdetail that list all the repeat of the events (with a id number, a title, a description, dates...).
If your event has 1 occurence (no repeat), you've got 1 event in the table #_jevents_vevent and one in the table #_jevents_vevdetail that are linked by the detail id number of the #_jevents_vevent and the id number of the #_jevents_vevdetail.
So the url is defined by a "icalrepeat.detail" for all the events (with repeat or not).
It's a bit complicated to work with that, but that's how it's work...
This topic is locked and no more replies can be posted.