Page 1 of 1
Populating a table after creation
Posted: Wed Nov 02, 2005 11:52 am
by korngold
Hi all,
Is this possible? I have a client who is requesting the strangest format I've ever seen and won't take no for an answer. The only thing I can figure out is to create the table first (like a template) and then populate the data aftwards. Is there a way to assign an ID or variable to each cell that needs to be populated?
Thanks in advance!
Posted: Wed Nov 02, 2005 11:53 am
by Grim...
Yes, with javascript, but why not do it as it is created?
Posted: Wed Nov 02, 2005 12:19 pm
by korngold
I have tried to figure out a way to do the data and the table simultaneously, but there's no way I can think of to do so. The table is an oddly-formatted calendar that is actually created using PHP, and it needs to go through at least 2010.
Here's what the calendar looks like:
Funky Calendar
So, I'm basically using the "cal_to_jd" function, incrementing by 1, creating a row, then when the month turns it adds another column and repeats. Plus, they have to have each weekday line up on the left. Can you tell this report was originally a spreadsheet?!?!
My only thought was to assign each "DATA" point with an ID based on the Julian Day Count, then load the data in. I need to enter info based on each specific date, so I was going to convert my data tables' "date" field to the Julian Day Count and try to match it up with the respective cell, but I can't figure out how to do it.
Posted: Wed Nov 02, 2005 1:06 pm
by korngold
Grim... wrote:Yes, with javascript, but why not do it as it is created?
How would I go about doing this using Javascript? Any option sounds good right now, since the customer needs this yesterday.
Thanks!
Posted: Wed Nov 02, 2005 3:41 pm
by Luke
You have to name the table elements and access them like you would a form.
I think it's something like this...
document.tablename.dataname.value...
here is where you would find out how to do so...
http://www.w3schools.com/htmldom/dom_obj_tabledata.asp