In the parameters of the textInput field you can have words show up in them by default (like name, email, etc.) Javascript function call:: One of my form in pure HTML has 1 text input field and 2 buttons. Pressing one of the buttons triggers a search-me() function. I'm also using the following http://answers.google.com/answers/threadview?id=743341HOME |
What I'm trying to do is have it so when you click on the field these words disappear. As it stands now, when I put a word in the parameter the user would have to erase it and enter in their own. Mobile Online-Community:: According to a proprietary survey of cell phone users by the high tech research firm, Wi-Fi- and Skype-enabled handsets, voice activation for text input, http://answers.google.com/answers/threadview/id/725444.htmlHOME |
I'd also like to have it greyed out a bit to, if that's possible.
Is this an actionscript issue or am I not entering it correctly in the parameters?
What the onkillfocus is doing is setting the textfields text to the value of the defaul variable, this way if the user just clicks on it and doesn't type anything in the text will reset back to enter some text if I'm not mistaken.
But if the user has entered text it will set the textfield to the text the user has entered , dont know if I made mysyelf clear there.
i think youd use the onSetFocus and onKillFocus for the text erase part of your question My website crashes IE:: So, if we use an "onChange" event handler in a text input box, and the user enters data and TABS out of the box, the onChange event handler is invoked. http://answers.google.com/answers/threadview/id/16063.htmlHOME | Mac OS X Programming: Dialogs, Controls and Events:: I understand you can process text input using Apple events, but that's not what I want to do here if I can avoid it. How do I do this? http://answers.google.com/answers/threadview?id=59561HOME |
ahh..I got it.
But in this code:
var _default:String = "enter some text";
inp_txt.text = _default;
inp_txt.onSetFocus = function():Void {
this.text = "";
}
inp_txt.onKillFocus = function():Void {
this.text = _default;
}
the onKillFocus will erase anything that the user puts in that area and replace it with, in this case, whatever is in the _default section defined at the beginning.
Is the best way to keep the user info to just get rid of the onKillFocus code?
In the parameters of the textInput field you can have words show up in them by default (like name, email, etc.)
What I'm trying to do is have it so when you click on the field these words disappear. As it stands now, when I put a word in the parameter the user would have to erase it and enter in their own.
I'd also like to have it greyed out a bit to, if that's possible.
Is this an actionscript issue or am I not entering it correctly in the parameters?
Use this code
instanceName.onSetFocus = function() {
this.text = "";
};
**edit a little late huh :lol:
Yup - you could do something like this:
var _default:String = "enter some text";
inp_txt.text = _default;
inp_txt.onSetFocus = function():Void {
this.text = "";
}
inp_txt.onKillFocus = function():Void {
this.text = _default;
}
:mountie:
aces...works sweet.
Thanks for your help!
Just an example :)
If you wish to use onKillFocus - you could do something like this:
inp_txt.onKillFocus = function():Void {
if(!this.text.length) {
this.text = _default;
}
}
:glasses:
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|