Hi,
I have just started converting some CF5 forms to CF6.
I had in CF5 some custom code to populate a form after API call to a database:
So I started to change to the CF6 function calls, but then in testing I found that both:
both seem to populate the form field. So maybe I just have to change "form" to "this". in each line. Being quite lazy, I am wondering if there is any problem with using the second format throughout my converted forms, or if it is necessary to use the CF6 function calls for some reason.
Cheers
Tim
I have just started converting some CF5 forms to CF6.
I had in CF5 some custom code to populate a form after API call to a database:
$form->data['field1'] = $sr['field_1'];
So I started to change to the CF6 function calls, but then in testing I found that both:
$this->data('field1', $sr['field_1'],true);and
$this->data['field1'] = $sr['field_1'];
both seem to populate the form field. So maybe I just have to change "form" to "this". in each line. Being quite lazy, I am wondering if there is any problem with using the second format throughout my converted forms, or if it is necessary to use the CF6 function calls for some reason.
Cheers
Tim
This topic is locked and no more replies can be posted.