0

I've updated the attendance.sql and the attendance form (index.php), but when I tried to update the values (e.g. present and late), it cannot work.
And also, the checkbox says it's all ticked even the values are different (lines 61 - 63 of index.php)

Can help me?

Download: https://drive.google.com/open?id=0B07_pOHhTox3bTN1Z21HRlR2TEE
Inside there is the database table called attendance.sql. You need xampp and you must import the table (attendance.spl) in phpmyadmin.

2
Contributors
2
Replies
18
Views
1 Year
Discussion Span
Last Post by SpottyBlue
0

Hi

And also, the checkbox says it's all ticked even the values are different (lines 61 - 63 of index.php)

what do you mean?checked is a boolean attribute, which means:

A number of attributes are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.

If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.

The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.

Source: https://developers.whatwg.org/common-microsyntaxes.html#boolean-attribute

so in order to set a checkbox you have to verify the value returned by the row and decide if you want to include the attribute, for example:

<input type="checkbox" name="present" id="present"<?php echo $row['present'] > 0 ? ' checked':'';?>>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.