Re: help javascript var

From: Date: Sun, 16 Jul 2000 15:23:00 +0000
Subject: Re: help javascript var
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-6818@lists.php.net to get a copy of this message
> I'm new to PHP and have this problem: > i need to value from javascript function assign to php variable > ( onChange in select statment need to pass to query of mysql) > is it possible to do that? Well, You can put a form on you page, and alter a hidden field in this for with favascript like: <form action=ascript.phtml> <input TYPE=HIDDEN NAME=your_variable> <input TYPE=SUBMIT> </form> and some javascript: function modifyForm { document.forms[0].elements[0].value = "a new value"; } which you can call before the form is submitted. You can now just access this variable in the ascript.phtml script, which is the forms target. print $your_variable; e.t.c. Hope this helps. Phil Messenger

« previous php.general (#6818) next »