PDA

View Full Version : form field



DDD
September 4th, 2003, 05:56 PM
Sorry guys for the double post.....But I am desperate. I have a flash form that I want to have a default value in when it is onBlur (or does not have focus) then onFocus the value goes away and the user is able to type. With a value in the field, when the field loses focus it retains the value placed in there. If they do not place a value in the field and the field loses focus it reverts back to the default value. Let me know if you need more clarity..

I saw sen (i think he helped someone with this before) in here that is why I doubled posted but it seems I have missed him :( ..Please dont ban me...

grandsp5
September 4th, 2003, 06:02 PM
yeah it can be done. Define 2 text format object then link them up to the onSetFocus and on KillFocus commands. Inside the onKillFocus, check to see if they entered anything, if not, back to the original format.

DDD
September 4th, 2003, 06:04 PM
grandsp5- thanks man

I am in no-way trying to lean on anyone for all their knowledge and I believe in finding things for yourself. But my AS is terrible could you kick me a lil snippet I can play with. I'll trade ya some photoshop knowledge :) (I barely get out of the D&D forum)

grandsp5
September 4th, 2003, 06:07 PM
sure. my Photoshop skills need work anyways. give me a little while.

grandsp5
September 4th, 2003, 06:10 PM
here i found an example I had lying around on my hd. This isnt exactly what you wanted but you should be able to add a check to see if there is any text in the field pretty easily.

DDD
September 4th, 2003, 06:21 PM
ok thanks I will have a look at it and see if I can put something together. I'll post if I get stuck.

DDD
September 4th, 2003, 08:47 PM
man that AS is really out of my league. do you have a lower life form example?

senocular
September 8th, 2003, 08:34 PM
something like this?

// input_txt is the textField instance name
input_txt.original_text = "Enter Text Here";
input_txt.text = input_txt.original_text;
input_txt.onSetFocus = function(){
this.text = "";
};
input_txt.onKillFocus = function(){
if (this.text == ""){
this.text = this.original_text;
}
};

Sorry if its the same thing you posted grandsp5, I didnt look at the file.

DDD
September 8th, 2003, 08:45 PM
nope this is a lil more understandable....thanks man.....

Also thanks grandsp5 but the extra stuff you had goingon in that file were to advanced for me and made it hard to decipher.

grandsp5
September 9th, 2003, 10:47 PM
Anytime. Sorry it didn't help. I actually posted the wrong thing. My bad. I posted the changing colors instead of the changing text :trout: