Re: Re: script problems
| From: | David Robley | Date: | Mon, 28 Apr 2003 11:53:21 +0000 |
| Subject: | Re: Re: script problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145573@lists.php.net to get a copy of this message | ||
On 28 Apr 2003 at 7:52, Prince wrote:
>
>
> ----- Original Message -----
> From: "David Robley" <robleyd@ozemail.com.au>
> To: <php-general@lists.php.net>
> Sent: Monday, April 28, 2003 7:25 AM
> Subject: [PHP] Re: script problems
>
>
> > In article <000901c30d75$04332020$2404a40c@andy>, friendly@kaltelnet.net
> > says...
> > > hi i have tis web page:
> > > <html>
> > > <head>
> > > <title>test web page</title>
> > > </head>
> > >
> > > <body>
> > > <form name="form1" action="index2.php"
> > > method="post">
> > >
> > > <input type="text" name="element1"><br>
> > > <input type="checkbox" name="checkbox"
> > > value="checkbox1" checked>
> > > <input type="submit"> </form> </body> </html>
> > >
> > > now the script index2.php??
> > >
> > > <?echo?>document.form1.element1.value<?;?>
> > > ....
> > > //all through the elements on the form...
> > >
> > >
> > > and my out put is:
> > > error on line 1 of index2.php?
> > > unknown or undefined object: document.form1.element1 is not defined
> > >
> > >
> > > im sort of lost now
> > >
> > > trying to use javascript with php
> >
> > Interesting syntax you have there :-) Input types are available under
> > PHP as a variable of the same name as the "name" assigned in the INPUT
> > tag - if you are using later versions of PHP with register_globals off
> > you will need to access them as $_POST{"name"} when using the post
> > method.
> >
> > If you want to access those values via javascript, you'll need to
> > include the correct javascript in your receiving script.
>
> the question is how to get the right values from php over to js script
>
> ??
Please keep you responses to the list - you are likely to get better
information than just asking one person.
Unless I misunderstand what you really want, I think you want to get the
values from the previous html page, not from PHP? This becomes a
javascript problem pure and simple. As I said, you need the correct
javascript in the receiving script; you can of course create the js
either as pure 'js in html' (outside php tags) or within php tags by
echoing the appropriate javascript.
--
David Robley
Quod subigo farinam
"I need an injection," Tom pleaded in vain.