Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

inputfield text changed in (4.6.0.f1)

Discussion in 'UGUI & TextMesh Pro' started by ManAmazin, Nov 8, 2014.

  1. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    wassup guys quicl question what do i use in place of :

    Code (CSharp):
    1. confirmPasswordField.text.text
    ?

    after upgrading unity thru up error for this piece of code as well as

    Code (CSharp):
    1. emailField.text.text.Length
    just seeing what i replace it with?
     
  2. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    im assuming that the input field knows we are referring to the text inside the box so the extra ".text" isnt needed am i correct in that assumption?
     
  3. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Haven't checked the new version yet. Maybe you really have a bug here. But i think it is because you want to access the content by text.

    Have you tried to use value instead of text? text is not the best thing to retreive from a input field. I was told to use value instead. Try confirmpasswortfield.value
     
  4. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
    yea i actually seen your thread and tried that first but there is no value accessor for me its weird
     
  5. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Last edited: Nov 8, 2014
  6. ManAmazin

    ManAmazin

    Joined:
    Aug 7, 2013
    Posts:
    246
  7. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Code (csharp):
    1. emailField.text.text.length
    becomes
    Code (csharp):
    1. emailField.textComponent.text.length
     
    gregory_igromatic likes this.
  8. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    input.text is now the text that the input field contains.

    input.textComponent.text is only the text that the input field determined is the visible text so may not be the same as input.text. Also textComponent.text will have asterisk chars if it is a password