The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

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.

why doesn't this simple code work?

Dreamweaver has this builtin js script to wipe out the data in a field ... useful for erasing the "enter in your search term here" from input fields by simply clicking in there.

But it has this annoying side effect that erases the value all the time. i jsut want it to wipe out the value on the first click ... as the user might enter in partial data, cope text somewhere else, then go to click the rest of the data in the field ... but this erases all the data again ... annoying.

so i figure, i'll jsut set a variable after it runs the first time and at the beginning on the function check if the variable is set, if not ... erase the value, if it is ... don't erase it.

so i'm a total JS newbie ... i code in php but new to JS ... why doesn't this work? it erases my data everytime i click into it ...