-
19 Apr 2012 6:56 PM #1
Answered: Component numberfield not works property 'maxLength'
Answered: Component numberfield not works property 'maxLength'
I have the following code, but not works:<br>
The <input/> allow more than 5 characters, why?PHP Code:{
xtype: 'numberfield',
label: 'Cantidad',
maxLength: 5,
stepValue: 1,
placeholder: '0',
clearIcon: false,
labelWidth: 85
}
{
___status: 200,
___job: 'freelancer',
___contact: 'fabiansneyder@gmail.com',
___webmaster: true
}
-
Best Answer Posted by mitchellsimoens
Looks like <input> with type = 'number' does not support maxlength attribute.
Some tests I did without Sencha Touch involved was this:
typed 12345 and would not allow more as expected.Code:<input type="text" maxlength="5" />
typed 12345 but could type more. This shows that the HTML5 spec for number type does not adhere to maxlength.Code:<input type="number" maxlength="5" />
-
20 Apr 2012 6:57 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
Looks like <input> with type = 'number' does not support maxlength attribute.
Some tests I did without Sencha Touch involved was this:
typed 12345 and would not allow more as expected.Code:<input type="text" maxlength="5" />
typed 12345 but could type more. This shows that the HTML5 spec for number type does not adhere to maxlength.Code:<input type="number" maxlength="5" />
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Apr 2012 7:04 AM #3
Thank You very much @mitchellsimoens
I think the solution will be using the keyup event{
___status: 200,
___job: 'freelancer',
___contact: 'fabiansneyder@gmail.com',
___webmaster: true
}
-
20 Apr 2012 7:28 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3108
btw, love your sig
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.



Reply With Quote