469,275 Members | 1,810 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

getting javascript-generated input element values with POST (php)

I'm having some problems.. I have some javascript generated input
elements with dynamic names and values.

ex:
<input name = "t1Name" .../>
<input name = "t2Name" .../>
.....
<input name = "tnName".../>
On submission, i'm trying to get the values in a php script using
$_POST and I can't get any values out of them.. always getting null.

Is it even possible to get javascript-generated input values using
php?

Thanks,
Ben
Jan 24 '08 #1
1 2168
Ben Brown wrote:
I'm having some problems.. I have some javascript generated input
elements with dynamic names and values.

ex:
<input name = "t1Name" .../>
<input name = "t2Name" .../>
....
<input name = "tnName".../>
On submission, i'm trying to get the values in a php script using
$_POST and I can't get any values out of them.. always getting null.

Is it even possible to get javascript-generated input values using
php?

Thanks,
Ben
Hi Ben,

From PHP (where the action in the form posts to), try this:
echo "Post contains:<pre>";
print_r($_POST);
echo "</pre>";
exit;

That way you will see WHAT the form has posted.

If you do not see your t1Name in that array, your form DIDN'T post it at
all.

Good luck.

Regards,
Erwin Moller
Jan 25 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Noorul Ameen | last post: by
3 posts views Thread by Jacques Chaurette | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.