There are two ways to do this, one is fairly simple.
If you have a form that will be submitted then you can create a dummy DIV in the form and inject <INPUT ../> tags in to the DIV so that when the form is submitted then your javascript variables go with the form
The second method is to communicate directly with the server using AJAX via the XMLHTTP object. This is more complicated but it requires no pressing of submit buttons.
Otherwise there is no DIRECT way to subsitiute javascript values into PHP variables as Javascript is a clientside script and PHP is a server-side script. They run only completely different computers.
Main Topics
Browse All Topics





by: martinewskiPosted on 2009-07-09 at 07:09:30ID: 24813812
You are actually using a javascript command into php code. That won't work.
It depends on the method you are using on your form. See below:
Select allOpen in new window