I don't know how to do this for Javascript, but I can explain in PHP as I have further experience in it. maybe someone can translate.
A textbox's value is "username", and it needs a onclick javascript code that makes it 'this.value = ""'
When users click the textbox that has the value of "username", it by javascript turns the value to "" (empty), how do i make it that it will only change the value to blank if the value is "username". not say... "admin".
So if they made changes to the textbox value to "admin" and they click the textbox again, it will stay not replace the value by ""(blank).
<?php
$usertext = $_GET['username'];
if($usertext == "username") {
$usertext = "";
} else {
return false;
}
?>