We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,610 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

To retrieve the array value in javascript

hi,
i am using php, javascript, ajax in my Timesheet project.
I made a grid displaying details of Timesheet such as Date, Day, Starttime, Endtime etc.
i coded this grid using table, input tag and displayed it in php.
i have used input tag name as array and i want to retrieve that value in javascript.

example:
<?php
for($i=1;$i<=$days;$i++)
{
$display_string .= "<td><input type='text' name='date[$i]' value='$dat' > </td>";
$display_string .= "<td><input type='text' name='day[$i]' value='$day' > </td>";
$display_string .= "<td><input type='text' name='stime[$i]' > </td>";
$display_string .= "<td><input type='text' name='etime[$i]' > </td>";
}
echo $display_string;
?>

How to get the value of input tag array value in javascript?

If anybody knows it, pls help me.

Thanks,
Yasodha.

2
Contributors
3
Replies
3 Hours
Discussion Span
5 Years Ago
Last Updated
4
Views
yasodhadevi
Newbie Poster
2 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

if (document.getElementById)
{
document.getElementById();
}


now you know what you have to look for.

fatihpiristine
Posting Whiz in Training
283 posts since Sep 2007
Reputation Points: 6
Solved Threads: 19
Skill Endorsements: 0

hi fatihpiristine,
if i am not using arrays in input tag program is working fine,

i have used this getElementById() also.
i am in need of the exact code , can u ?

Thanks for ur reply.

Yasodha.

yasodhadevi
Newbie Poster
2 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

well. i m working on sql script since morning without any break... when i finish.. i will post the code you need.

fatihpiristine
Posting Whiz in Training
283 posts since Sep 2007
Reputation Points: 6
Solved Threads: 19
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0619 seconds using 2.7MB