Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Editing with javascript

    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?

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    865
    Thanks
    7
    Thanked 29 Times in 28 Posts
    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.
    Ess

  • #3
    New Coder
    Join Date
    Jan 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •