I’m just messing about trying to figure out cakephp which looks like it’s going to be a lot of fun.
I have a form input which goes like:
echo $form->input('Campaign.title', array('maxLength'=>'76px'));
which outputs:
<label for="CampaignTitle">Title</label><input name="data[Campaign][title]" type="text" maxLength="76px" maxlength="255" id="CampaignTitle" />
notice the two values for the maxlegth. How can I get rid of the second “255” value which seems to be preferred in IE.
Try to pay attention to your capitalization of the html property “maxlength”
Cake will auto determine the max length for certain field types by the length of the database column. In your case you want to override this field’s length – a varchar(255) – to be 76 instead of the 255 the field can allow for.
But in your helper call you are setting an attribute “maxLength” – notice the capitalized “L” – which isn’t the actual attribute “maxlength”.
So – to fix your helper call, remove the “px” and change the key from “maxLength” to “maxlength”