How do I set a PHP variable from Javascript?
Posted: Thu Mar 02, 2006 7:55 pm
I have a PHP (popup) page which is a list of checkboxes.
I'd like to fill in PHP session variables with the checked results
instantly, as soon as a checkbox is checked (or unchecked).
I.E., I don't want to have a Submit button to gather the results,
as the user could just close the popup after making selections,
without hitting the Submit button.
Thus, I was thinking of using Javascript OnClick on each checkbox.
But then, even if I write a Javascript function as the object of the OnClick,
how do I pass an On or Off value to a PHP variable from Javascript,
as the whole purpose is to store the results in a database field from
the PHP variables?
(Be nice if this was a DUH!! answer....)
Any ideas?
Thanks
....Vidya
http://www.webwisesage.com
I'd like to fill in PHP session variables with the checked results
instantly, as soon as a checkbox is checked (or unchecked).
I.E., I don't want to have a Submit button to gather the results,
as the user could just close the popup after making selections,
without hitting the Submit button.
Thus, I was thinking of using Javascript OnClick on each checkbox.
But then, even if I write a Javascript function as the object of the OnClick,
how do I pass an On or Off value to a PHP variable from Javascript,
as the whole purpose is to store the results in a database field from
the PHP variables?
(Be nice if this was a DUH!! answer....)
Any ideas?
Thanks
....Vidya
http://www.webwisesage.com