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 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2009
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Editing Table Row Values ?

    Hi
    I'm using basic HTML to create a table. 8 columns wide and multiple rows.
    Due to it's size it can take several seconds to get the data and present it on screen.

    When the data is displayed I would like to be able to double click on a row and have that row editable.

    Each row will need to be a form as there are hidden values I need to submit as well as the cell data.

    When I click away from the row, I want the values passing back to javascript so I can use PHP to save them.

    1. is this possible ?
    2. any ideas ?

    I've found a couple of scripts, but nothing that is similar to this.
    Thanks

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,719
    Thanks
    25
    Thanked 662 Times in 661 Posts
    Yes this is possible. Put 'edit' button in 9th cell for every row. use onclick to call javascript. Change the 'edit' button into a submit or a finished editing or what ever name button to send the new info off to your DB. So
    When I click away from the row,
    changed to submit the row. and
    I want the values passing back to javascript so I can use PHP to save them.
    look up and use AJAX for this.

    Each row will need to be a form as there are hidden values I need to submit as well as the cell data.
    You really don't need forms for this. Your server side script will know what row was edited and know what those hidden values are so a form is not needed.

    Study this for many ways to change the DOM http://www.w3schools.com/js/js_ex_dom.asp

    Personally I would use something like a shadow box LIKE div to display the row for editing.


  •  

    Posting Permissions

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