What I have
I'm using the FormController to create inputs. A specific input will be frequently updated by Javascript for internal purposes and I want it hidden. In this case, I can't use type="hidden", instead it needs to be type="text" so that it won't be checked by the form tampering prevention when submitted.
What I tried
- Adding
'hidden' => trueto$this->Form->create()options works if the whole form needs to be hidden. That exact attribute doesn't seem to be working for individual inputs though, created using both$this->Form->input()and$this->Form->control() - For a specific input, first thing that comes to mind is adding
'style' => 'display:none'to its options, but that does not seem like a clean CakePHP-way solution - I think I've seen someone mention a way to do exactly that here. I think it was an attribute you'd add to the options. I searched around my answers and comments, using both this site and Google, but found nothing.
Please advise!