PHP Form Submission

Ok - see below what I have - it looks good with one exception. The first element on the first repeat group value does not show...

The unique thing about this element 'change_calendar_167_repeat___peg_department_approvals' is that it is a database join element. Should that matter?

repeat.JPG db_repeat.JPG






Code:
$formModel->formData['change_calendar_167_repeat___id'] = array(
    '',
    '',

);

$formModel->formData['change_calendar_167_repeat___id_raw'] = array(
    '',
    '',

);

$formModel->formData['change_calendar_167_repeat___parent_id'] = array(
    '',
    '',

);

$formModel->formData['change_calendar_167_repeat___parent_id_raw'] = array(
    '',
    '',

);

$formModel->formData['change_calendar_167_repeat___peg_department_approvals'] = array(
    'Tier3',
    'NOC'
);

$formModel->formData['change_calendar_167_repeat___peg_department_approvals_raw'] = array(
    'Tier3',
    'NOC'
);

$formModel->formData['change_calendar_167_repeat___approval_status'] = array(
    'Pending1',
    'Pending'
);

$formModel->formData['change_calendar_167_repeat___approval_status_raw'] = array(
    'Pending1',
    'Pending'
);

$formModel->formData['change_calendar_167_repeat___approved_by_calc'] = array(
    'Pending Department Approval1',
    'Pending Department Approval'
);

$formModel->formData['change_calendar_167_repeat___approved_by_calc_raw'] = array(
    'Pending Department Approval1',
    'Pending Department Approval'
);

$formModel->formData['fabrik_repeat_group'][167] = '2';
JFactory::getApplication()->input->set('fabrik_repeat_group', $formModel->formData['fabrik_repeat_group']);
 
Last edited:
For a join, you'll probably need to use the value (not the label) for the _raw. You may also need to provide them as arrays, like ..

Code:
$formModel->formData['change_calendar_167_repeat___peg_department_approvals_raw'] = array(
    array('2'),
    array('5')
);

... or whatever.

Best way to test is to put this as the first line of the script:

Code:
var_dump($formModel->formData);exit;

... then submit a form with those two groups filled in on the form. Then you can see exactly how the formData array should look.

-- hugh
 
My work-around right now is to set the default value to NOC. This will set the first value for me - then the subsequent values will populate correctly.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top