Posted by Matt Brown - identify on 07/13/07 02:20
Hello,
My goal is to make an input check box that saves an input text to a
cookie when checked and destroys the cookie when unchecked.
I figured i could use the onclick method of the input box to execute
the PHP function setcookie, but how do I get the value from the input
text? Testing with the window.alert function, inputtextName.value
doesn't work in the PHP:
<html>
Your name:
<input class="selectstyle" type="checkbox" name="savename"
onclick='window.alert("savename.value")'><br>
<input class="inputstyle2" type="text" name="name" value="<?php echo
$_COOKIE["name"]; ?>">
literally "savename.value" is alerted.
I need the cookie value to echo.
Help is appreciated,
Matt
[Back to original message]
|