trouble with OnClcik event
Posted: Sat Jun 26, 2010 4:00 am
Hi all,
for some reason I do not understand the $_SESSION variable I guess.
I have a form with a text box with some initial text. When a person wants to enter the text box the default text disappears. This works fine. But the text should only disappear once. So When onclick is done the text should be removed once. I thought doing this using the session variable:
In the script I all add. Session start(); But each time I enter the text box the text disappears. The $_SESSION['click'] is not set to true or it does not remember this. I have no clue. I miss something small.
for some reason I do not understand the $_SESSION variable I guess.
I have a form with a text box with some initial text. When a person wants to enter the text box the default text disappears. This works fine. But the text should only disappear once. So When onclick is done the text should be removed once. I thought doing this using the session variable:
Code: Select all
function clickevent(){
if(!isset($_SESSION['click'])){
echo "\"forms.recepttoevoegen.naam.value =''\"";
$_SESSION['click']=true;
}
}