Need sample - one-to-many data array

I

IVer Erling Årva

Hi!

I am looking into making a database application and to limit the
client<->server traffic I want to handle all entry/amendment of the data in
the browser and save it all once the entry is completed. The problem is that
I need to include a dynamic table where the user can add, amend and delete
rows. For the sake of illustrating what I mean I can use the person / pet
sample where you have one person with several pets, e.g.

Person name:
Phone:
----------------------------------
Name: Type: Colour:
Pet1: [Delete]
Pet2: [Delete]
Pet3: [Delete]
[Add pet]

I need sample code to show how to handle this array (or a similar situation)
in terms of adding rows and deleting rows etc. I have tried to look for info
on this, but cannot find a decent sample anywhere...

Thanks!
(e-mail address removed)
 
D

Douglas Crockford

Yes, I thought that might be it. I had however hoped that someone had a
ready made full fledged example with all the bells and whistles. It's so
much easier when you have some example code to look at. I am trying to get
going with a new database lanquage and find the combination of HTML,
JavaScript, SQL and the database object script (all of which are new to me)
a bit much, especially as I have to do it all by myself. So I thought that
rather than reinventing the wheel etc...

You probably want an array of objects. JavaScript is particularly nice for those
sorts of structures. Look at the examples at www.JSON.org. Also Check out
www.crockford.com/javascript/survey.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,082
Messages
2,570,588
Members
47,209
Latest member
Ingeborg61

Latest Threads

Top