Adding items to a List

C

Craig

I have an editbox, with an add butoon next to it. The add button should add
what ever the user enters into the dit box, into a listbox.

When the save button is clicked (Using PHP here), the contents of the box
must be written to a table.

Is this possible?
 
E

Els

Craig said:
I have an editbox, with an add butoon next to it. The add button should add
what ever the user enters into the dit box, into a listbox.

When the save button is clicked (Using PHP here), the contents of the box
must be written to a table.

Is this possible?

Sounds like a guestbook...
 
C

Craig

No, it's a page where you can add names to a database. But it must be done
at once. Not add a line, write database, add a line, write database.. etc.

It must be add items to list, then write when the save button is clicked.
 
M

Mitja

Craig said:
No, it's a page where you can add names to a database. But it must be done
at once. Not add a line, write database, add a line, write database.. etc.

It must be add items to list, then write when the save button is clicked.

should

Not a very elegant solution, but here goes:

1) EditBox no. 1 - user input goes here
2) ListBox - here you display the names user has already entered
3) *hidden* EditBox - you fill in this one (using JavaScript) with something
like
"this is name1|this is the second name|foo|bar"

You may choose any separator, not neccessarily |, of course. Just make sure
users don't enter a line containing your separator. Anyway, the contents of
this hidden EditBox is the what your script should read and parse
appropriately, probably using a split() function or something similar.

Mitja
 

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
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top