I am using CakePHP 2.2.4.
I am using the Form Helper to create a form. I need to have a form input with no name attribute.
Is this possible with the formhelper or should I just use HTML for creating this form?
eg in HTML:
<input type="text" maxlength="20" autocomplete="off" class="card-number stripe-sensitive required" />
Basically Am I able to do the above using the formhelper in CakePHP ?
Thanks.
You can overrule any property in the
$optionsarray, which is the second argument to theinput()method. So technically you could do:But please be aware the dropping the
nameattribute makes the entire field useless if you want to do anything with it’s data in your controller/model, as the$this->dataarray gets it’s names from the name attribute of your input fields.