Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

AutocapitalizationType not changing

I need a textfield to not autocapitalize but setting the AutocapitalizationType:'None' seems to have no effect.

What am I doing wrong?

var siteURLField = Titanium.UI.createTextField({
    hintText:'enter site URL',
    height:35,
    top:35,
    left:30,
    width:250,
    AutocapitalizationType:'None',
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
    value:Titanium.App.Properties.getString('siteURL')
});
— asked April 8th 2010 by rob stevens
  • autocapitalizationtype
0 Comments

4 Answers

  • Accepted Answer

    i think the property is called:

    autocapitalization

    at least in the kitchensink example textfield_therest.js

    — answered April 8th 2010 by Christian Sigl
    permalink
    0 Comments
  • instead of none, use this 'static' var:

    TEXT_AUTOCAPITALIZATION_NONE

    most of the properties in ti views are using integer values in the background

    you'll find a list of static vars here (scroll down to end the page): https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.UI

    — answered April 8th 2010 by Christian Sigl
    permalink
    0 Comments
  • Thanks Christian,

    I tried:

    ...
    width:250,
    AutocapitalizationType:Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
    ...
    

    With no change.

    In the Docs I do not see a Titanium.UI.TextField property to match the iPhone AutocapitalizationType.

    — answered April 8th 2010 by rob stevens
    permalink
    1 Comment
    • Apparently suppressing auto-cap works, i.e. this constant, but not the other constants that request special caps like TEXT_AUTOCAPITALIZATION_WORDS. I cannot get init-cap functionality to work at all on my first/last name fields.

      — commented September 9th 2011 by Michael Stelly
  • Super, works great thanks.

    — answered April 8th 2010 by rob stevens
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.