RE: [PHP] PHP/Javascript Help
| From: | Ford, Mike [LSS] | Date: | Fri, 06 Jun 2003 09:22:19 +0000 |
| Subject: | RE: [PHP] PHP/Javascript Help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150468@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Stephen [mailto:webmaster@melchior.us]
> Sent: 05 June 2003 19:15
>
> Here's my javascript link code for each day of the month in
> the calendar script:
>
> print "<a href=\"#\"
> onClick=\"window.opener.document.".$HTTP_GET_VARS['name'].".da
> te.value='$y-$m-$d';\">$d</a>";
>
> $HTTP_GET_VARS['name'] holds the text field name, ie
> delivery[3322ffds]. If I replace the name either order in the
> text field and as the variable I pass in the URL it works fine.
You need to make use of the JavaScript ['id'] identity with .id (see any good JavaScript
book for more on this), thus:
print "<a href=\"#\"
onClick=\"window.opener.document['" . $HTTP_GET_VARS['name'] .
"'].date.value='$y-$m-$d';\">$d</a>";
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211