• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

checkbox redirect to another form...

KAISER

New Member
Hi! Can you help me? Maybe this is a classic problem, but it's makes me so confused. Well, I'm not an expert in php, but can you redirect a primary form to another secondary form -it's a specific form that I created with fabrik too- via selecting a check box and echoing/print the submitted result to that specific form at the same times? Off course if the check box remains unchecked, it just print the result without appearing the specific form.

The specific form that I mentioned before is an attachment form, with the primary form check box element's name is [tick_boxes3], sub element's value [abstract_enclosed], and the form's id [7].

Second question, how to join the tables between this two form data?

Sorry for the troubles, and sorry for my bad English :)
Thank You!
 
Do you mean that when you submit the first form, you want it to redirect to a second form, the URL of which will depend on the value of a checkbox on the first form?

If so, this might be possible with by using {placeholders} in your jump page URL. For instance, if you make it so the value of the checkbox is the ID of the form you want to go to, something like:

index.php?option=com_fabrik&task=viewForm&fabrik={tick_boxes3}

... assuming that the value of tick_boxes3 is 7.

Of course, this would only work if a) it's a single select set of checkboxes, and b) each chechbox maps to a form.

But to do true "conditional" redirects, where you only redirect to a different form under specific circumstances ... no, 1.0.x won't do that. You'd have to be running J! 1.5 and Fabrik 2.0, and write a custom form submission plugin, based on the existing 'fabrikredirect' plugin (which provides the same functionality in 2.0 as the 'jump page' stuff in 1.0.x).

To join the tables, I presume you mean that you would want a join element on the second table which points back to the PK of the first table, and have that automatically filled in when you open/submit the form. In which case, you would append something like "&table_name___element_name[value]={rowid}" to the jump URL above. But of course that's not going to be easy if you are trying to do some kind of conditional jumping.

On the whole, I'd have to say that this would be tricky to do in 1.0.x.

I think the only real way to do it would be to write a form submit script, set to "When Fabrik has finished processing the form (simple eval)" (or whatever that option says), which looks at the submitted data, and returns a 'Location: ...' header if necessary.

But if you aren't a PHP coder, that could be problematic.


-- hugh
 
Thank You for your great explanation Hugh :)

Now I understand why the first version of fabrik can't do some "conditional" redirect. Maybe I need to upgrade to the latest version of Joomla and fabrik.

Well, now I need to learn more about this php thingies :p

Oh, one question again, sorry if this sound out off the topic, can you build the text field element side by side? I mean like this:

[text_area_element1][text_area_element2]

Not like this:

[text_area_element1]
[text_area_element2]

Thank You very much! :)
 
It is possible by customizing a template, but this does require a small amount of PHP knowledge. It's probably also possible with some CSS styling.

In 2.0, you can specify multiple column groups, so you'd just put your two elements in their own group, and specify '2' as the number of columns for that group.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top