View Full Version : Editing with javascript

01-01-2007, 07:52 PM
I am trying to make a table wherein I can edit the value of the cells of the table just by clicking on them. Is this possible?
I want it to be like a browser-based excel type of interface.

Would I toggle the visibility of the text and a hidden input form when the user clicks on the text?
But then wouldn't that require separate forms for every single cell?

01-01-2007, 09:20 PM
There are many ways to do this.

I think the coolest way is to create a form, input fields, etc on the fly once a user has clicked on a given table row. However, this might be quite difficult...if you are not used to coding in JavaScript.

The easiest option would be to create form inside a hidden div. The div becomes visible once a user clicks on a given row. You then have to have a hidden field which would contain the id of the row that you are currently editing. Once the user clicks on update or save changes...you need to have a way to handle the processes of applying changes...by noting the id of the row that was updated.

Hope that helps.

Good luck.

01-02-2007, 05:05 PM
Could you show me how to do either option?
I'm not very good with javascript. I can usually understand what a script does, but I don't think I can do something this advanced yet :P