On click go to url (with form) and fill the desired element

mbevc1

Member
Hi,

I wonder if it is possible to accomplish the scenario explained below.

Using the fabrik element button and javascript I would like to (on click) go to the desired form (url) and automatically pre-fill some elements.

Please help.

Thank you in advance.
 
What do you want to fill the elements with? Values of element on the form you the button is on? If so, yes, something like ...

Code:
var form = Fabrik.getBlock('form_1'); 
var something1 = form.formElements.get('yourtable___something1').getValue();
var something2 = form.formElements.get('yourtable___something2').getValue();
window.location('index.php?option=com_fabrik&view=form&formid=2&othertable___something1=' + something1 + '&othertable___something2=' + something2);

Substitute your form id's and element full names as appropriate.

The takeaway here is that by appending &othertable___something=blah to the URL of the other form, you preset those elements. And you get those 'blah' values with getValue() on the current form elements.

-- hugh
 
Yes,

I want to fill the fields of the form I am currently viewing. Basicaly I need to push values of some elements of the form A (on url A) to form B (on url B) with the push of a button.

So I guess this can be done with your tip.

Thank you. I will try to play around with your solution.

Best regards.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top