PHP/Javascript Help
| From: | Stephen | Date: | Thu, 05 Jun 2003 18:15:10 +0000 |
| Subject: | PHP/Javascript Help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-150386@lists.php.net to get a copy of this message | ||
Hello,
I'm trying to use a calendare script to select a date in another form. I got the calendar
working and I've got it all working except one bit of error.
I'm repeating a table field to get all these items into a table. Each row of the table has
it's own text field where the user can type in when they want the item to be delivered.
That's where the calendar comes in. It opens a new window, displays the calendar, and
that's that. The problem I'm having is when the user click the date, they get an error,
one of those "Expected ] on line whatever."
I can see what the problem is. Since I repeat the form field, I made the field's name
delivery[item_id] and item_id is replaced with the item's id currently being displayed. I need
to keep this array so, how can I fix this error? I tried doing the \[ trick since that works with
apostrpohes but it didn't seem to work. Any help would be great!
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'].".date.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.
I'm not yours, so why should I be sincere about it,
Stephen Craton
Senior Executive Web Developer
Mophus.com, Inc.