jeudi 26 mai 2016

Jquery Code to Auto Check a Checkbox Base on Day of a Date

I want to auto check a checkbox if the day of a date is equal to the value of that particular checkbox.

For instance if the date is 2016-05-26 (the day being Thursday), then i want to automatically check the checkbox which has the value Thursday.

So the code should be able to pick the day of the date and also check the right checkbox.

Hope my question is clear enough.

Below is the html code for the checkboxes.

<input value="Sunday" multiple="" type="checkbox" style="" name="repeat_on[]" title="Sunday"> S 
<input value="Monday" multiple="" type="checkbox" style="" name="repeat_on[]" title="Monday"> M
<input value="Tuesday" multiple="" type="checkbox" style="" name="repeat_on[]" title="Tuesday"> T
<input value="Wednesday" multiple="" type="checkbox" style="" name="repeat_on[]" title="Wednesday"> W
<input value="Thursday" multiple="" type="checkbox" style="" name="repeat_on[]" title="Thursday"> T
<input value="Friday" multiple="" type="checkbox" style="" name="repeat_on[]" title="Friday"> F
<input value="Saturday" multiple="" type="checkbox" style="" name="repeat_on[]" title="Saturday"> S

I will so much appreciate this effort.




Aucun commentaire:

Enregistrer un commentaire