PDA

View Full Version : [CLOSED] MaxLength Property



softmachine2011
Jun 26, 2012, 9:16 AM
Hi,


<ext:TextField runat="server" MaxLength="10" FieldLabel="MaxLength=10" />

In v2 MaxLength markup property doesn't works. I can write infinite text an when I pass maxlength validation activates, but in previous v1.x versions, behaviour is that maxlength is max text that you can write.

Is this the new behaviour or an issue?
If is the new behaviour, is there any simple way to recover old behaviour to all textfields, textarea, ... in my app?

Daniil
Jun 26, 2012, 2:08 PM
Hi,

Please follow:
http://forums.ext.net/showthread.php?19472&p=84486&viewfull=1#post84486

softmachine2011
Jun 26, 2012, 2:37 PM
Is there any way to setup this property true by default?
Or I have to setup up to true to all fields in my application?

Daniil
Jun 26, 2012, 2:50 PM
Example

Ext.form.field.Text.prototype.enforceMaxLength = true;

It will allow to set up true by default on the JavaScript level for a separate page.

Personally, I would prefer to set up the server EnforceMaxLength property for all fields you are using MaxLength for.

softmachine2011
Jun 26, 2012, 3:14 PM
Ok thanks. I appreciate your suggestions.