ok, today I\'m making a helper HTML function. It looks like this:
function Input($name,$type,$lable,$value= null){
if (isset($value)) {
//if (this.value==\
If I understand correctly, SO uses this line of HTML to do that effect.
Not related to your question, but you could and should replace your second if statement with an else statement.
function Input($name,$type,$lable,$value= null){
if (isset($value)) {
//if (this.value=='search') this.value = ''
echo '';
}
else {
echo '';
}
}
Because if isset($value) returns false then you know for a fact that it isn't set since it can only return one of two values, true or false.
EDIT: Disregard this answer. It was not clear what the question was before the edit.