Forums

booking form that reduces seat availability on submission

skutter 04 Sep, 2013
Hi,

I'm creating a booking form for bus tours which have 48 seats available. As the places are booked I need way of reducing the number of seats available so that there are no double bookings.
Could anyone recommend the best way to do this?

I also need to create a unique booking reference so that each booking can be tracked effectively for internal administration and customer communication..

Although I'm not a PHP programmer I'm always willing to have a go but I'm not sure where to start - any guidance is always appreciated.
GreyHead 04 Sep, 2013
Hi skutter,

To do this you need to save the responses to a database table using a DB Save action in the form On Submit event.

You will need to have a column to identify the individual tour.

There are various ways of setting up the form; I'd probably add code (a MySQL query) to check availability of the tours when the form loads and then only availability where there are spaces left.

I have a Unique ID [GH] action which generates a Unique ID in the form of a short random string.

Bob
skutter 05 Sep, 2013
Hi Bob,

Thanks for the swift reply. The Unique ID [GH] action is absolutely perfect for my needs I'm also using your Load User Info [GH] to grab the Joomla user data.

I appreciate your advice on the MySQL query I'm going to follow this approach. Although I may need some additional guidance as I go.

I'm also experiencing another issue with Double Dropdowns - I've followed the faq here;
http://www.chronoengine.com/faqs/3927-how-can-i-add-a-simple-double-drop-down-without-ajax-.html
But changes in the first dropdown do not change the second dropdown options.
The debug doesn't list any of the entries in the $form->data array either?

CFv4 Joomla 2.5.14
GreyHead 05 Sep, 2013
Hi skutter,

There's probably a JavaScript error on the page. What do you see in the Console in your web browser Web Developer tools?

Bob
skutter 08 Sep, 2013
The js errors are;
An unbalanced tree was written using document.write() causing data from the network to be reparsed.
and
TypeError: $(...) is null

My dynamic dropdown list is;

One:Single=Single,Disabled=Disabled
Two:Twin=Twin,Double=Double,Disabled=Disabled
Three:Twin+1=Twin+1,Double+1=Double+1,FamilyRoom=FamilyRoom,Disabled=Disabled
Four:Twinx2=Twinx2,Doublex2=Doublex2,FamilyRoom=FamilyRoom,Disabled=Disabled
Five:Twinx2=Twinx2,Doublex2=Doublex2,FamilyRoom=FamilyRoom,Disabled=Disabled
GreyHead 08 Sep, 2013
Hi skutter,

This one looks to me as though there is a problem with MooTools - either it's not loading or maybe jQuery is conflicting for the $
TypeError: $(...) is null

Please post a link to the form so I can take a quick look.

Bob
GreyHead 08 Sep, 2013
Hi skutter,

There are a couple of things here that might be causing problems.

The first is that you need to add an id to the places_required select drop down, at present it just has a name and that is causing an error if you view the form without the template.

Second is that there seems to be a problem related to the Email Cloaking plug-in - turning that off temporarily will help you check that.

The template or some other component is loading JQuery but that is being put into noConflict mode and hopefully won't be a problem.

Bob
This topic is locked and no more replies can be posted.