Xtremer360 Posted December 9, 2010 Share Posted December 9, 2010 Old issue of mine that I'm coming back to. My question is I'm trying to figure out how to work with the select box of options and apply button so that if delete is chosen and the user clicks on apply it performs the deletedivision inside the process page I know it deals with jquery's ajax however this part of it does not that I'm trying to get fixed because as of right now I have if (isset($_POST['deletedivision'])) and I know that's not right and I know I can't apply a name to the option tag because name isn't one of option's allowable attributes. mods/divisions.php <form action="" method="post"> <label for="actionSelect">With selected items: </label> <select class="select" name="actionSelect" id="actionSelect"> <option id="1">Edit</option> <option id="2">Delete</option> </select> <button class="button small-button"><strong>Apply</strong></button> </form> <?php while ( $row = mysqli_fetch_array ( $result, MYSQL_ASSOC ) ) { echo ' <tr> <td><input type=checkbox class=checkbox name=checkbox[] id=checkbox[] value="' . $row['id'] . '" /></td> <td>' . $row['divisionname'] . '</td> <td>' . $row['name'] . '</td> <td class=last>' . $row['datecreated'] . '</td> </tr>'; } ?> processes/divisions.php if (isset($_POST['deletedivision'])) { $checkbox = $_POST['checkbox']; $countCheck = count($_POST['checkbox']); for($i=0;$i<$countCheck;$i++) { $del_id = $checkbox[$i]; $query = "DELETE from `divisions` where id = $del_id"; mysqli_query($dbc,$query); } } Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted December 9, 2010 Author Share Posted December 9, 2010 I'm at least trying to find something that can lead me to some information about how to handle the matter and I'm about lost. Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted December 13, 2010 Author Share Posted December 13, 2010 Any ideas? Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted January 10, 2011 Author Share Posted January 10, 2011 Instead of recreating this topic I just bumped it up so that I can maybe get some answers for this post. I have the process page finished but what I'm trying to do is when the user ticks a check box and then makes a selection of either Edit or Delete from the drop down menu it will do one of two things. If the user selected Edit then they will be taken to the edit form with the passed id value and load use that passed value to load information from the database and if the user had selected Delete from the drop down menu then it'll use well jQuery's Ajax function to handle delete the row from the db. The issue I'm having is figuring out with this template is how to pass the id value up to that other form with the drop down menu. 129 or so line code http://pastebin.com/bBim31RK 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.