I have a list of records in a table with a checkbox beside each one.
The user selects a number of records by ticking the checkbox and then selects an action from a drop down list of links.
<div class="button-group">
<button type="button" id="but1">Action</button>
<ul class="dropdown" id="dropdown-but1">
<li><a href="#">Update Attendees</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">One more action</a></li>
</ul>
</div>
An example of an action might be updating if a user attend an event.
if(isset($_POST['submit']))
{
foreach ($_POST['checkbox_mark'] as $value => $dummy) {
$option = isset($_POST['checkbox'][$value]) ? '1' : '0';
// Send the Data to the Model
$eventRegistrationModel->markAttended($value, $id, $option);
}
}
At the minute I have this working for a single submit button, but I would like the user to be able to choose from a list of options in a dropdown and then the appropriate action is called.
I can't seem to find an example of this, but I am maybe not searching for the correct term. Assuming I will need to use jquery for this.
I have found a way to do this using the form elements https://stackoverflow.com/a/17423522/1472203 but wondering if it is possible with text links.