Set ccd defaults from URL

arie

Member
Hi, I have followed the instructions described here http://fabrikar.com/forums/index.ph...dating-a-form-s-value-before-showing-the-form in order to pre-set default values of a CDD (called CDDx) in a repeated group. This CDD (CDDx) watch element option field is linked to an autocomplete dropdown (Da).

I use a php form plugin on the OnBeforeLoad event and below the code:

Code:
//add 2 repetaed groups
$repeatedGroupCount["19"]="2";
JRequest::setVar("fabrik_repeat_group",$repeatedGroupCount);

// pre-set a regular field
$formModel->data['ass_donation___amount_don']=22; 

// pre-set the dropdown (Da)
$formModel->data['ass_donation___donator_id']=6;
$formModel->data['ass_donation___donator_id_raw']=6;

// pre-set the CDDs (Dx) in the repeated groups
$formModel->data['ass_promesse_donation___promesse_id_raw'] = array(22654,22655);
$formModel->data['ass_promesse_donation___amount_promesse_donation'] = array(222,223);

Until here it works like a charm, however after the page is fully loaded, the 2 CDDs (Dx) are refreshed by, I guess, Fabrik codes, and the pre-set default values of the CDDs are also refreshed.
Any ideas for what I need to do please?
 
Yeah, no point setting CDD values on the server side during load, as we always fire an update on CDD's as part of attaching them to the form, which will then populate them with whatever data matches the watched element value.

Are they refreshing with different values? I would have expected them to refresh with the same values you set, assuming those are the values that would match the values you set the watched element to.

-- hugh
 
Are they refreshing with different values? I would have expected them to refresh with the same values you set, assuming those are the values that would match the values you set the watched element to.
They refreshing with the default value "Select a value".
And yes the value I set individually, already exists in the options
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top