How to reset all the fields in the form on each refresh in CakePHP?
+2
A:
Are you asking how to make Cake not put data into the forms automatically, when using the form helper inside a view? If so, Cake just takes the data inside Controller::$data and uses matching array indeces to field names to populate those fields. To stop this, just set $this->data = null; in your controller's action that corresponds to the view.
Travis Leleu
2010-02-25 16:52:24
A:
As mentioned you can make all form data unreachable by setting $this-data to null. You can also view the HTML page generated, what names the form elements have, and can selectively unset $this->data['objectName'] or $this->data['objectName']['memberName'].
sibidiba
2010-02-25 20:15:10