For each Candidate in my system there are 3 separate forms: Registration, Training and Employment.
Users have to fill in the Registration form first.
I would like to make a button (from the Candidate Form or Detail view) that would link to one of the other Forms (Training or Employment) and pre-populate the Candidate field.
Just like in Fabrik, in the Groups view, there is an Elements column with an Add button, and it links to an Element Form with the Group field pre-populated.
I had a look at the following documentation:
http://fabrikar.com/forums/index.php?wiki/set-element-defaults-from-url/
http://fabrikar.com/forums/index.php?wiki/button-element/
http://fabrikar.com/forums/index.php?threads/how-does-the-button-work.31450/
I created a Button element in my Candidates Registration Form (formid=1) to link to the Training Form (formid=20).
The JS script is as follows:
var url1 ="index.php?option=com_fabrik&view=form&formid=20&formacao___candidato=";
var url2 =Fabrik.getBlock('form_1').formElements.get('candidatos___id').getValue();
var url =url1.concat(url2);
window.location.replace(url);
It does create a button in the Form and the Detail views, but not in the List view (where I would need it to be).
In the Detail view the button does not work (it is displayed but clicking doesn't do anything)
In the Form view the button works but the link (see below) is missing the url2 part. I am quite sure I made a mistake in the getBlock('form_1') since I did not understand what ('form_123') was refering to in the documentation.
http://www.boagente.com/wconsult/IN...rik&view=form&formid=20&formacao___candidato=
Thanks,
Mathieu
Users have to fill in the Registration form first.
I would like to make a button (from the Candidate Form or Detail view) that would link to one of the other Forms (Training or Employment) and pre-populate the Candidate field.
Just like in Fabrik, in the Groups view, there is an Elements column with an Add button, and it links to an Element Form with the Group field pre-populated.
I had a look at the following documentation:
http://fabrikar.com/forums/index.php?wiki/set-element-defaults-from-url/
http://fabrikar.com/forums/index.php?wiki/button-element/
http://fabrikar.com/forums/index.php?threads/how-does-the-button-work.31450/
I created a Button element in my Candidates Registration Form (formid=1) to link to the Training Form (formid=20).
The JS script is as follows:
var url1 ="index.php?option=com_fabrik&view=form&formid=20&formacao___candidato=";
var url2 =Fabrik.getBlock('form_1').formElements.get('candidatos___id').getValue();
var url =url1.concat(url2);
window.location.replace(url);
It does create a button in the Form and the Detail views, but not in the List view (where I would need it to be).
In the Detail view the button does not work (it is displayed but clicking doesn't do anything)
In the Form view the button works but the link (see below) is missing the url2 part. I am quite sure I made a mistake in the getBlock('form_1') since I did not understand what ('form_123') was refering to in the documentation.
http://www.boagente.com/wconsult/IN...rik&view=form&formid=20&formacao___candidato=
Thanks,
Mathieu