Quick check. Your suggestion is working. I have the below code.
So if the Count is 0 it disables the form with the error msg.
if the count is 1, it lets the user select the required course but does not let him select the additional course option (since he can do only 1 course submission) which is what i want.
But for some reason the submit button is not working for course count = 1.
It's enabled , but when i click on it nothing happens. Looks like i need to enable the submit button which i also tried in the below code (i have it commented out).
I tried both the submit formats below but it doesnt help in making the submit work.
$('.Submit').show();
$('.Submit').prop("disabled", false);
$(function()
{
$('#q27').hide();
$('#q25 input').change(function(){
if ($('#q25 input').val() ==0)
{
alert("Max count REACHED");
$('#q27').show();
$('#q4').hide();
$('.Submit').hide();
$('.submitMsg').hide();
//$('.Submit').prop("disabled", true);
}
else
if ($('#q25 input').val() ==1)
{
alert("Count 1 Reached");
$('#q4').show();
$('.Submit').show();
// $('.Submit').prop("disabled", false);
$('#q20').hide();
$('#q15').hide();
}
})
}
);
#q27 - Error msg which should show when count = 0
#q25- course count
#q4 - course type dropdown (course selction)
#q20 and #q15 additional courses seelction ( which needs to be hidden when course count is 1.