Page 1 of 1

Change Font Color In Textbox Problem

Posted: Thu Mar 08, 2012 2:32 pm
by Mikey
I wanted to implement one of the textboxes as follows:
When the box is empty, I display some default help text in a light grey color - for example, for a phone number it might say "7 digits, no area code"
When the user taps the box to edit it, the text disappears, the text color changes to black, and thus anything the user types on the keyboard shows in black.

The only part of this that does not work is switching the text color. I have tried putting a script in the field, and I have tried using a button to manually change the color of the text in the field, but no dice.

The magic code is
set the uuiTextField["textColor"] of group "test1" to 0,0,0

And to prove that it works,
answer the uuiTextField["textColor"] of group "test1"


I get the 0,0,0 reply but the text color is not different.

Re: Change Font Color In Textbox Problem

Posted: Thu Mar 08, 2012 5:51 pm
by gpb01

Code: Select all

set the uuiTextField["textColor"] of group "test1" to 0,0,0
Never done, but ... are you sure about the syntax ? Have you see here : http://mobgui.com/doc.php?docId=26 ?

For 'text native controls' I think that you have to use or the "iphoneControlSet" syntax or the "mobFieldSet" ...

Guglielmo

Re: Change Font Color In Textbox Problem

Posted: Thu Mar 08, 2012 6:20 pm
by Mikey
Aha! That works. Apparently the documentation needs to be updated -- the documentation for the native text field at http://mobgui.com/doc.php?docId=11 was what I was using. Thanks!

Re: Change Font Color In Textbox Problem

Posted: Thu Mar 08, 2012 6:37 pm
by gpb01
Happy to have helped :)

Guglielmo

Re: Change Font Color In Textbox Problem

Posted: Thu Mar 08, 2012 9:47 pm
by Mikey
Nope. I spoke too soon. A field does not appear to be able to set its own textColor. Back to square 1.

Re: Change Font Color In Textbox Problem

Posted: Thu Mar 08, 2012 9:50 pm
by Mikey
Spoke too soon again - you CAN use this technique BUT you cannot use ME as the target. You have to spell the name out