Hi
I'm using Machforms to create a booking system for a one day event with three sessions and a limited amount of places available for each session submitted from one form using a checkbox
Checkbox1 - session1 - 9-12pm
Checkbox2 - session2 - 12-1pm
Checkbox2 - session3 - 1-5pm
The client wants the checkboxes to be disabled as and when each individual session is booked out.
Not being a programmer I've achieved it by using this db query on the php page that i have my embed code for the form .
Then I've used a Javascript function to disable it and change the class on the label. This works ok but it's not ideal as it's clientside, is there anyway to do this with PHP?
Thanks for your help.
$query = "SELECT COUNT(element_5_1) AS element_5_11 FROM ap_form_2
WHERE element_5_1='1' ";
$result = do_query($query);
$row = do_fetch_result($result);
if ($row[0] >= 10) {
echo 'there are equal or more than 10 entries in 9am-12pm';
echo '<script type="text/javascript">disableCbx1()</script>';
}
