User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,564 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,578 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1964 | Replies: 3
Reply
Join Date: Oct 2007
Posts: 2
Reputation: yasodhadevi is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yasodhadevi yasodhadevi is offline Offline
Newbie Poster

Tutorial To retrieve the array value in javascript

  #1  
Oct 23rd, 2007
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: To retrieve the array value in javascript

  #2  
Oct 23rd, 2007
if (document.getElementById)
{
document.getElementById();
}


now you know what you have to look for.
Do a favour, leave me alone
Reply With Quote  
Join Date: Oct 2007
Posts: 2
Reputation: yasodhadevi is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
yasodhadevi yasodhadevi is offline Offline
Newbie Poster

Help Re: To retrieve the array value in javascript

  #3  
Oct 23rd, 2007
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.
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: To retrieve the array value in javascript

  #4  
Oct 23rd, 2007
well. i m working on sql script since morning without any break... when i finish.. i will post the code you need.
Do a favour, leave me alone
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:49 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC