Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

retrieving values from dynamically added html table row

Options
  • 22-05-2009 10:01am
    #1
    Registered Users Posts: 197 ✭✭


    Hi

    I have a php page which displays rows from a mysql database and allows values to be modified and saved by posting the values to a php file which updates the database.
    I have added a java script function to create a blank row in the html table but I can't figure out how to access the new values to save them to the database. They don't appear in the $_POST array. I am guessing that I need to use javascript somehome but I can't figure out how. Ideally I want all the processing to occur in the called php file, is this possible?

    Thanks

    Dave


Comments

  • Registered Users Posts: 6,509 ✭✭✭daymobrew


    Please post a link to the code or the output html.


  • Registered Users Posts: 197 ✭✭cracker


    Sorted, it was my lack of experience with html.
    I was putting a form element around each row but it seems that I can only wrap a form element around a complete table or inside a single cell and so the html formed was invalid.
    So I put an outer table with a single cell per row and then nested my original table inside this.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Do you really need loads of forms?


  • Registered Users Posts: 197 ✭✭cracker


    Possibly not, I'm certainly open to suggestions.

    I have summary information about a person and then a list of dates associated with that person which is displayed as a sub table.

    If I don't implement each person's details as a separate form then for any edits to be saved I would have to do updates for every person on the page. I thought performance wise it would be better to have a separate form for each person so that I just update the person who was modified? The list of dates for each person can be quite long.

    The only other alternative that I can see is to have a separate page that displays the details for a single individual.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    It's hard to tell without seeing the page, but it could well be easier with multiple forms too. If it's working OK, then just leave it!


  • Advertisement
Advertisement