behrk2 Posted November 23, 2007 Share Posted November 23, 2007 Hey guys, I will try and explain this as clearly as possible: I have a PHP page that displays the f_name, l_name and status for any person of whom their status = 'Pending'. Basically, I have the page set up with one table. In each cell I have <?php echo $f_name ?>, <?php echo $l_name ?>, and <?php echo $status ?>. So if there is more than one record, another table is automatically generated with the second record. Now, next to each record (in each table) I have a two html form buttons: Approve and Deny. The table is surrounded by a form area. If Deny is pressed, then status has to change to 'Denied'. If Approved is pressed, then status has to change to 'Approved'. Here lies two problems: First, I have NO way of differentiating the records from the first table from the records in any other table that was automatically displayed. Second, the records are not displayed in a form element. They are merely a PHP echo. So I cannot POST any of the records. To get around this, I established hidden fields for each cell where the hidden field is = to the PHP echo. This worked, however again, if there are two records, the hidden field elements are set to the records from the last table. The hidden fields for each table will not hold their own distinct records. ...ah. I hope I explained that well. Does anyone have any ideas!!! Thanks so much! Quote Link to comment https://forums.phpfreaks.com/topic/78496-question-for-php/ Share on other sites More sharing options...
PHP_PhREEEk Posted November 23, 2007 Share Posted November 23, 2007 What is the HTML under the buttons? If they are just type="submit" buttons, then this won't work. You will need to assign 2 radio buttons, properly named, and texted Approve and Deny with a value of 1 or 0 respectively. Then an actual submit button will send those variables to the processing page to act on them. Bottomline is, you can only have one submit per form, and the only workaround is a javascript or AJAX solution. PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/78496-question-for-php/#findComment-397278 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.