If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Pre-populate form with cursor location on page load

Hello,
I'm trying to figure out how to get an input form field to be pre-populated with text on page load as well as having the cursor location in the same input field on page load, and I need to have the pre-populated text disappear when the user actually manually clicks in the input field. It seems I can only have one or the other, but I have seen it done with both the pre-populated text in the form field along with the cursor location in the same input field, where the pre-populated text disappears when the user clicks in the input field. If you need to see the code I'm working with or if there are any questions please let me know.

Only one aspect of the solution...

Thanks, 007Julien. Your suggestion has one aspect of the issue I need help with (the form field pre-populating with the field value, as your example has), but what I am needing is the form field pre-populated with text (such as First Name) but with the cursor in the same field, on page load.

So what the user sees is a form field with the field pre-populated with text (such as First Name, Zip Code, etc) and the cursor placed by default on page load in that same form field where the pre-populated text appears. The text would then disappear when the user manually clicks in the form field.

One last question, 007: is there a way to make it so that the text disappears if you use your mouse to click in the field where the cursor already is? At this point, on page load, the pre-populated text is either highlighted or the cursor is in front of the pre-populated text (depending on the browser), but when certain users inevitably click in there with their mouse, the pre-populated text doesn't disappear. You then must manually highlight it and delete it. Any suggestions?