Passing variables to a Frabrik Form from another page?

Status
Not open for further replies.

peternemser

New Member
Hi All,

I trying to build a course registrations system. The system is basic, but I have no clue the way to do this in Fabrik.

The scenario

1) A user selects a page with multiple courses. After each course description there is a button name "book now".

2) Clicking the "book now" button would then jump to another page with a form. THe course name would appear in the form (or on the page) and the user would put in there information.

Whats is the easiest way to accomplish this. I know this is a bit vague.
 
How you go about this kind of depends on whether the courses have a common data format, in other words do they all have the same basic data - course name, course date, course location, that kind of thing.

If the answer is yes, then it's relatively straightforward. You'll basically want two tables/forms - courses and bookings. The 'courses' table/form will be private - you'll use that for adding / removing courses. The 'bookings' table/form will be the one your customers see.

Here's the "fifty thousand foot view" of how to do it:

Create a group 'courses'
Create elements for 'courses' - course_name, course_location, course_date, whatever you need - and assign them to the 'courses' group.
Create a form for 'courses', assign the 'courses' group to it. Make sure you select 'record in database'. The table will be automatically created when you save the form.

Create a group 'bookings'.
Create elements for 'bookings' - booking_name, booking_email, etc. Also create a 'database join' element, which links to the 'courses' table, using 'id' as the key (Fabrik will have automatically created this when it created the 'courses' table) and 'course_name' as the value.

Test your 'courses' form by going to Tables admin page, 'view database', then 'add record'. Create a new course and save it. Add a couple of test courses.

Now test your 'bookings' form by going to Table admin page, 'view database', then 'add record'. The form should include a dropdown of all the courses you added above.

Once you have this working, and we'll cover the next step of linking to it from some static content, and passing the course ID to it.

-- hugh
 
Hi Hugh,

I am feeling it, thanks for such clear directions. So how now do I pass the variable to the bookings form - to preselect the course that I want to book it on.

Regards,
Peter
 
OK ... when you link to the form, append &full_element_name[value]=whatever to the URL.

So if your 'bookings' form is ID 13, and the db join element you created is course_id, and this link is for course ID 12, append ...

&jos_fabrik_formdata_13___course_id[value]=12

... to whatever link you are using to go to the booking form.

-- hugh
 
Hi Hugh,

I think I might be doing something wrong with the passing of the variable to the the new form.

The join element in the bookings form is named course_join

I am trying to have the form element named course_join =- (which is a drop down ) select the course name I am sending it via the url. IE the course becomes the default. I do not want the use to have to reselect the course.

See attached PDF link.

http://sail-laser.dorydesigns.com/hugh_dudeman.pdf
 
First off, thanks for taking the time to put that very clear PDF together. Makes my job a lot easier!

I was thinking that it should have done exactly what you want. The next step would have been to simply hide the join element. Not quite sure why it didn't work. I shall do some testing and get back to you.

-- hugh
 
That doesn't work because your table___element name is wrong. Try this:

http://sail-laser.dorydesigns.com/m...m&fabrik=17&jos_fabrik_bookings___course_join[value]=2

If in doubt about what your table / elements are called on a given form, just view the source in your browser. Even if you no speaka da HTML, it's pretty easy to work out what the elements are called. In this case, just search for course_join and you'll see what I mean.

By the way, I notice that vB doesn't seem to like the []'s when displaying URL's, so you'll have to tack that last part on by hand!


-- hugh
 
Thanks Hugh _ You Rock

Hugh - yes it all works now - thanks so much!! I am so happy with the subscription service that you folks provide. Many thanks and so excited for 2.0.

Regards,
peter Freedman.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top