Hello Experts,
I am currently working on developing a form that includes a JavaScript validation function for a radio group. The main objective is to have a division pop up when either "Monday" or "Tuesday" is checked, and no popup when "None" is selected:-
//the form
<form name="form_sf" id = "form_sf" method="post" action="process.php" onSubmit="return check_sf_form_info(form_sf,'all')">
<input name="date" id="date" type="radio" value="nil" onChange="check_sf_form_info(form_sf,2)" />None
<input name="date" id="date" type="radio" value="mon" onChange="check_sf_form_info(form_sf,2)" />Monday
<input name="date" id="date" type="radio" value="tue" onChange="check_sf_form_info(form_sf,2)" />Tuesday
</form>
//the javascript
function check_sf_form_info(form,mark,edit){
if(mark==2 || mark=="all"){
if(form.date.value!=="nil"){
price.innerHTML="$100";
price.style.display="block";
price.style.height="auto";
}else{
price.innerHTML="";
price.style.display = "none";
}
}
}
I would appreciate it if experts could kindly point out any mistakes in my code. Thank you very much!