How do I reset all form fields in a view when I refresh the page in CakePHP?

How to reset all fields in a form on every update in CakePHP ?

0


source to share


2 answers


Are you asking how to make Cake not automatically place data on forms by using the form helper inside the view? If so, Cake simply takes the data inside the Controller :: $ data and uses the appropriate array indices for the field names to populate those fields. To stop this, just set $ this-> data = null; in your controller action corresponding to the view.



+4


source


As mentioned, you can make all form data inaccessible by setting $ this-data to null. You can also view the generated HTML page what names the form elements have and you can selectively disable $ this-> data ['objectName'] or $ this-> data ['objectName'] ['memberName'].



0


source







All Articles