Hi Team
I have this code below, the issue with my checkbox are not displaying and there is not js file conflict when inspecting the element from the browser. What could be an issue? Please assist, thanks.
//css
#input[type=checkbox] {
-webkit-appearance: checkbox;
-moz-appearance: checkbox;
appearance: checkbox;
}
// html and php
Booking Courses
The courses available for booking or registration by the student.
Tuhin PaulPosted Feb 3, 2025, 5:35 PM
Part -1
The issue with your checkboxes not displaying is likely due to the CSS selector being incorrect. The selector
#input[type=checkbox]is invalid because#is used for IDs, butinput[type=checkbox]is a generic element selector.Replace the incorrect CSS with:
input[type="checkbox"]is the correct selector for targeting checkboxes.appearance: checkboxensures the checkbox is displayed as a native checkbox.Explicit
widthandheightensure consistent sizing.If you want to style the checkboxes for better UI/UX, use this approach:
CSS for Custom Checkboxes
HTML Update
Wrap the checkbox in a
labelwith thecheckbox-containerclass:Tuhin PaulPosted Feb 3, 2025, 5:43 PM
You can add validation to check at least one course is selected: