I need to solve this problem:
When a checkbox (“Session1”) is ticked, then a “Select” list (“Course”) should be filled from a dropdown list on condition that if “checkbox” is checked/”true” AND “select list” is empty, then the “select list” should be filled. And vice versa.
Right now I have this jquery code in my form:
$("#Session1").click(function () {
{
if($("#Session1").attr("checked")==true)
{
alert("Course field is required");
}
}
});
Thank you so much for your help!
Demo: http://jsfiddle.net/AlienWebguy/n4xZU/
To force a required checkbox, simply check if it’s required:
Demo: http://jsfiddle.net/AlienWebguy/n4xZU/2/