groundnuts Posted April 13, 2012 Share Posted April 13, 2012 I generated a table from the database, and at the end of each row there are two submits, one for save and another for delete. The values are generated as either text and select box input. Right now, I have all the submits named differently (ends a number), so I can loop through all available submits based on the number to check which row needs to be updated, and to retrieve the values during form processing, then only perform the query. I have also hidden input in each row to send the "primary key" that is used during query. Is there a better approach than to have so many different names for the buttons, not having to loop through all of them each time, and still keep a similar layout? I'm trying to avoid anything else than PHP. The table looks something like: col1____| col2_______| col3____|__________________ txt input | select input | txt input |save bttn | delete bttn txt input | select input | txt input |save bttn | delete bttn Quote Link to comment Share on other sites More sharing options...
batwimp Posted April 13, 2012 Share Posted April 13, 2012 Can you post a screen capture of your form? Quote Link to comment Share on other sites More sharing options...
Psycho Posted April 13, 2012 Share Posted April 13, 2012 You seem to be making it much more complicated. I *think* you are trying to do all of this with one form. Since you have multiple submits, each with the relevant inputs, you should be using multiple forms. And each form would just have fields with the exact same names. That way your forms are more organized and your processing script is simpler as well Seeing your current page structure would help to be able to provide some sample code Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.