Validate Radio Button

When a select the radio button the error message isn’t disappearing.


function validate_accounttype(){
		if (entrepreneur.checked !== "checked" && investor.checked !== "checked"){
			show_error(accounttype_msg, 'Account type is required.');
		}else{
			removeChildren(accounttype_msg);
			return true;
		}
	}

Do I have the wrong syntax?

There are a couple of problems: entrepreneur.checked !== “checked” should be
entrepreneur.checked == false; or, alternatively, entrepreneur.checked != true;

Also, I wouldn’t use !== as it means “not exactly equivalent in all respects”, which means it will fail if you are comparing a string with a boolean, even though they may look alike.

Thank you… that fixed it.