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 ...

Code:
function MM_setTextOfTextfield(objName,x,newText) { //v3.0
if (!(clickedalready == 1)) {
  var obj = MM_findObj(objName);
  if (obj) obj.value = newText;
  var clickedalready = 1;
}
}