how to get element value from raw Form ( form not submitted)

ritesh123

Member
Hi

I have a Form, where i have 3 Elements
Text
Multiselect Dropdown
Single Select Dropdown

Before User Submits the form, i want to get the value of above 3 elements using PHP and want to capture this values in a variable.

For multiselect Dropdown i want to capture this with comma separated value

I tried with POST_ function but is not working.

Any suggestions?
 
If you want to run PHP before user submits the form, then I guess we are talking ajax.

(Standard Fabrik stuff which uses ajax is calc, autocomplete (dropdown / dbjoin / cdd), google map and upload - but I think there is an example file somewhere which you can use to create your own ajax functionality.)

What you haven't said is what you want to do in php with these three fields? If you could provide a little more information we can probably help further.

S
 
I want the value of those 3 Fields and use in Mysql query to show a table.

This 3 Values will be show on top of a table.+ " GO" button
As we select this 3 values it should show a table below. The table will get filtered based on selection of those 3 values.
Also my dropdown list is multiselect dropdown so it will hold values in array

Please let me know if you have any example query like this
 
I don't have any examples of exactly this. You definitely want an ajax function to do the selecting, and you need to think about how to display the table.

To display repeating data (like your table) in Fabrik, you would normally use a Repeat Group. But in this instance that does not seem to be the solution because it cannot be ajaxed.

An alternative would displaying a List in an iFrame with the iFrame being ajaxed based on changes in the three fields you have. But we don't have an iFrame element, but if you are up for it, I guess you could create a new element plugin for iframes as all the building blocks for this exist in Fabrik.

But your best bet is probably to use the calc field though this would have some difficulties. You would need to use calc php to look up the values and then format them as an HTML table - and it would be the HTML which is stored in the database field associated with the calc. I have no idea how it would display - but I would imagine on a labels-on-the-left display it might look ok.

There are some examples on how to run an SQL statement in a calc in the wiki I think.

S
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top