Sometimes we are asked in an HTML form to list the characteristics of an element in 1 on checkboxes . Example:
Select 1 with areas of interest for your job application.
Then we must obtain the C/U ID of the areas of interest that you select and validate if at least 1 checkbox has been selected.
How do I do it?
So to solve this problem I did the following:
These checkboxes are ready dynamically. I get everything directly from the database.
In my form I have:
And in Javascript
I hope it serves you, helps you and I hope to be brief and concise with my contribution. If not, suggest a better solution, cheers!
this could work