Hello,
How do I clear text in my text field when I start typing into it?
For instance, I have a default text string in my text field but as soon as I type a letter I want to clear the field.
Thanks!
Clearing text in text field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Clearing text in text field
Hi.
Not sure I get this. You already have text in a field, and you want to insert the cursor into that field so that the very next character you type clears the original text so the new text can be entered from the top?
You know that when you click on an editable field, the insertion point is automatically set at the end of the existing text, right? So if you have an empty field, the cursor seems to be at the beginning, and if you already have text, the cursor is at the end. This is actually identical behavior, if you think about it.
Please write back if any of what I just said makes sense to you, or if any of it is pertinent to what you are trying to do. There are about a million ways to do this sort of thing, but I suspect that what you actually asked for is not the best way to go about it, (that the first char typed, after setting the insertion point in existing text, makes that text go away, and the new text starts at the beginning).
Craig Newman
Not sure I get this. You already have text in a field, and you want to insert the cursor into that field so that the very next character you type clears the original text so the new text can be entered from the top?
You know that when you click on an editable field, the insertion point is automatically set at the end of the existing text, right? So if you have an empty field, the cursor seems to be at the beginning, and if you already have text, the cursor is at the end. This is actually identical behavior, if you think about it.
Please write back if any of what I just said makes sense to you, or if any of it is pertinent to what you are trying to do. There are about a million ways to do this sort of thing, but I suspect that what you actually asked for is not the best way to go about it, (that the first char typed, after setting the insertion point in existing text, makes that text go away, and the new text starts at the beginning).
Craig Newman
Re: Clearing text in text field
EDIT:
Try this in the field script, and see if it is sort of what you had in mind:
Try this in the field script, and see if it is sort of what you had in mind:
Code: Select all
on openField
put empty into me
select text of me
end openField
Re: Clearing text in text field
Thanks dunbarx!! That was exactly what I was looking for 
