Here is the code I've created for validating my form.
$(function () {
$('#subbtn').click(function () {
if ($('#course').val('x')) {
$('#s1').show();
}
if ($('#sem').val('x')) {
$('#s2').show();
}
});
HTML
<button id="subbtn" type="submit>Submit</button
<span id="$s1" style="display:none;">*</span>
<span id="$s2" style="display:none;">*</span>
#course and #sem are the ids of List boxes.
After leaving both blank and press button it works properly (both the star will display), but after selecting first listbox and leave the second one empty, and prss the button then it gives the same result (that is, shows the both stars instead of one)
Please help, Thank you in advance