Form Plugon onLoad: Change Dropdown Default-Value

mhelm

Member
I use an onLoad-Script to change some default-values in a form.
assigning a string works perfectly:
$formModel->data['ww3fab_form01___textvalue']='example';

but how do I change the default-value for a dropdown-field?
I tried to set the raw-Value...but this doesn't work:
$formModel->data['ww3fab_form01___Country_raw'] = 'AT';

Any helpwould be great. Thanks!
 
The dropdown element is special. It should do by setting the value without _raw

$formModel->data['ww3fab_form01___Country'] ='AT'; (assuming AT is the value, not label)
 
works...as soon as I used the correct (case-sensitive) element-name: $formModel->data['ww3fab_form01___country'] ='AT';
Thanks for pointing me there!
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top