Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Why does Form->SetFormValue unset the rest of the form fields?

LincLinc Admin
edited July 2010 in Vanilla 1.0 Help
Normally if I have an edit form, I can just do something like this in the controller:
$this->Form->SetData($this->DataModel);
and it will pre-populate all the fields with the model I loaded. But now let's say I have a special case like the Form->Date method, which, for whatever reason, won't get correctly set by doing that. So I have to manually say:
$this->Form->SetFormValue('DateBegins_Month', 
date('m', strtotime($this->DataModel->DateBegins)));
for each of the 3 fields (Month, Day, Year). Problem is, calling SetFormValue once will unset the rest of the form fields, which means now I have to call SetFormValue on ALL of them one at a time. Is that the way it's supposed to work? It's creating an awful lot of extra code for me.
Sign In or Register to comment.