dynamic tables

D

decoy

Hi everyone,
Does anybody know how I can achieve the following?

I have a table that displays some information in plain text, on each
row I have an edit button that will allow the user to enter new values
for this row (basically display the same information as before but in
text boxes with the edit button replaced with a confirm button). When
the user has updated I would like to go back to the plain text view
with the new values.

Now comes the hard part ;)

I want to do all of this clientside, allowing the user to click on a
save button when they have editting that will re-enter all of the
information back to the DB.

I've looked into the following but it's not really what I intended:
http://www.scheinwelt.at/~norbertf/devel/websheet/

Sample code would be greatly appreciated!

Thanks in advance,

Stu.
 
J

Jim Higson

Hi everyone,
Does anybody know how I can achieve the following?

I have a table that displays some information in plain text, on each
row I have an edit button that will allow the user to enter new values
for this row (basically display the same information as before but in
text boxes with the edit button replaced with a confirm button). When
the user has updated I would like to go back to the plain text view
with the new values.

Now comes the hard part ;)

I want to do all of this clientside, allowing the user to click on a
save button when they have editting that will re-enter all of the
information back to the DB.

It can't be done completely client-side, you'd still need a thin server
script to listen to and validate information from client and enter it into
the database. This could be done without reloading the client's page
though, using XmlHttp.
I've looked into the following but it's not really what I intended:
http://www.scheinwelt.at/~norbertf/devel/websheet/

Sample code would be greatly appreciated!

What you want can be done with Javascript + DOM without too much fuss, but I
wouldn't recomend it as a first project in those technologies. Is system102
a web design company? In which case, maybe you'd be better off outsourcing
the work?
 
D

decoy

Thanks for the response.

Sadly outsourcing is not an option, so I'll have a go at the JS+DOM
solution (it sounds like fun :)

I guess if I create an invisible row with a text box in, then when a
user wants to edit the contents of a row the plain text row becomes
invisible and the textbox one becomes visible.
Then somehow the changes will be reflected back to the plain text one
when the user saves it.
 
J

Jim Higson

Thanks for the response.

Sadly outsourcing is not an option, so I'll have a go at the JS+DOM
solution (it sounds like fun :)

I guess if I create an invisible row with a text box in, then when a
user wants to edit the contents of a row the plain text row becomes
invisible and the textbox one becomes visible.
Then somehow the changes will be reflected back to the plain text one
when the user saves it.

You could, but I would just scan the row and replace all the text nodes with
input elements showing the old text node's content.

Javascript: the Definitive Guide (O'Reilly) is a good book on stuff like
this.

Have fun!
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top