Forum Moderators: open
I`m writing a script that has a log in area and the user can choose to set a cookie if he wishes by clicking a checkbox. I have used the onclick() function to display a simple alert message when the box is checked. ie:
<input type="checkbox" name="cookie" value="yes" onclick="check()">
Javascript code:
<script language="JavaScript" type="text/JavaScript">
function check()
{alert("NOTE!\n\nThis will keep you signed in on this computer for 30 days. This function is not recommended for shared computers.\n\nCookies must be enabled for this feature to work.\n\nThank you!");
}
</script>
This works fine, and the message appears if I check the box, however, when I uncheck the box, it appears again.
Is there a way to have the message appear ONLY when the box is checked?
Thank you!
Just realised I have posted in the wrong section. This can be moved to Javascript. Sorry about that. :(
[webmasterworld.com...]