Disable Checkbox by comparing dates

+1 Harshit Punn · March 1, 2015
I am working on a project and need some help. I want to do something like this

1. This is checkbox 1 (2015-03-02 to 2015-03-09)

2. This is checkbox 2(2015-03-05 to 2015-03-15)

3. This is checkbox 3(2015-03-13 to 2015-03-19)

All the checkbox are having same class and their data is extracted from database. 
If i check checkbox 1 then checkbox 2 should get disabled as date of checkbox2 is lying in the duration of dates of checkbox 1. Simillarly when checkbox 2 is checked then checbox1 and checkbox 3 should get disabled because of dates. This will happen with a large number of checkboxes.

Post a Reply


Oldest  Newest  Rating
0 Abdullah Nauman · March 5, 2015
For that you can use Radio Boxes:

<form action="">
<input type="radio" name="date" value="">2015-03-02<br>
<input type="radio" name="date" value="">2015-03-13<br>
<input type="radio" name="date" value="">2015-03-15 <br>

Hope I helped :)! If you help with anything else, feel free to ask!
  • 1



Query is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.

Abdullah Nauman Administrator