We are building a website for a small company that will organize trips.
On the website there will be 7 categories of trips. Within each category there are several different trips. Visitors should be able to apply for a trip (no payment yet, that will be handled separately) on a particulary date. Each trip is organized on 5 to 10 different dates.

How should I implement the form using which visitors can apply for a trip? The problem is that each trip is organized on a different set of dates. This makes that the form will look different for each trip: the dates which can be selected are different and the name of the trip will be different.

I have been looking at webforms. I can make a different form for each trip. This would be fine if the set of trips would not change. This is however not the case. Therefore I looked at the possibility to have only one form, which is parametrized.
- the name of the trip can easiliy be handed over to the form using the URL.
- the dates however are a bigger problem. I can not use the URL for this. I could use PHP variables but I don't know how to set them.

My question is: how should I implement this?
Is webforms the way to go or are there other ways of implementing this? Modules I missed?
What do you think of the way I consider using webforms?

Any help/thought is highly appreciated.

Comments

itsallhell’s picture

Your 7 categories will become 7 catalog items.

each catalog item wil have several different products. Each product will have date attribute which users can fill in.

basby’s picture

Thank you for your suggestion!

Isn't ubercart too much for my simple problem? May be it is what I need but I have the impression that it offers so many features I do not need.

I have downloaded ubercart and all modules it needs to test it. Any suggestions on the ubercart installation in my specific case are appreciated!

basby’s picture

I have had a look at übercart and I really think übercart is too big for me. There must be another more lean solution.

The only thing I need is a way to let people tell us which trip they want and on what date they want to go. The name of the trip is not a problem, the date is.

Without the date, webforms would do the trick.

With the date it is more complicated. Webforms can make use of php variables. If I only knew how to set php variables on the page which links to the webform.
I could specify $d1, $d2, $d3 etc. on the page. In the webform I could specifiy $d1, $d2 etc. as the dates people can choose from.

Anyone who can help on this? Anyone who can explain why this is (not) the way to go? Anyone who knows a better way to go?

basby’s picture

My final solution is: webforms.

I make use of one webform. It uses session variables. The page on which users push the button to go to the reservation page (the webform), sets session variables for each date the particular trip is on.
On the webform the session variables are presented in a selection list (%session[sda1] and %session[sda2] etc. where sda1 and sda2 are session variables).

The same is done with the name of the trip. It is also a session variable.

Note: make sure to initialize each session variable each time a visitor views a page which sends visitors to the webform.

Voila!

deemoney’s picture

Hi,

I just read your post, after pondering for days on a solution similar to the one you have implemented.

I was just wondering if you could showcase your final solution to the trip reservation using webforms?

What search parameters are presented to the user in the UI?

How is the form validated?

I will be very happy to get your feedback.

Best regards!