Error On Post Of Form With Maxlength Set

Hi guys,

I have gotten some weird error lately on one of my models. Here’s the context:

  1. I have a model with the field “area”, it has a “array(‘area’, ‘length’, ‘max’ => 25)”.

  2. On the client side, the form input itself, which is a text type, I set maxlength="25".

Now, when validating server-side I get the error "model errors: area[0]=Area is too long (maximum is 25 characters)"

I can’t see how this may happen except someone not posting from the webiste.

Anyone have any clue here?

Thanks a lot!

OM

on 2 you set maxlength="25" in the view file?

whene you define rules(), it set automatically.

delete it.

Hi and thanks for your interest,

Yup, sure. And I have tested that the input only takes 25 chars client side. Everything works fine, but every now and then I get this error which seems so weird.

OM