I have a form where a user can select a list of events, each event has the start time as a classname. When the form is submitted, I need to check if the user has selected more than one event with the same starttime.
e.g. In Today if the user selected Event A and Event C, it would trigger the validation message.
<form>
<h3>Today</h3>
<input type="checkbox" name="date" class="starttime-1730" value="A" />Event A
<input type="checkbox" name="date" class="starttime-1600" value="B" />Event B
<input type="checkbox" name="date" class="starttime-1730" value="C" />Event C
<input type="checkbox" name="date" class="starttime-1630" value="D" />Event D
<h3>Tomorrow</h3>
<input type="checkbox" name="date" class="starttime-1830" value="A" />Event A
<input type="checkbox" name="date" class="starttime-1830" value="B" />Event B
<input type="checkbox" name="date" class="starttime-1930" value="C" />Event C
<input type="checkbox" name="date" class="starttime-2030" value="D" />Event D
<input type="submit" name="submit" />
</form>