function checkForm(TheForm) {
if (document.example.date2.disabled == true) {
if (document.example.date1.value == "yyyy-mm-dd") {
var msg = "date not chosen from calendar icon";
alert(msg);
return false;
}
}
else{
if (document.example.date1.value == "yyyy-mm-dd" || document.example.date2.value == "yyyy-mm-dd") {
var msg = "start or end date not chosen from calendar icon";
alert(msg);
return false;
}
if(document.example.date1.value > document.example.date2.value){
var msg = "choose proper date-Start date is greater than end date";
alert(msg);
return false;
}
if(document.example.date1.value == document.example.date2.value){
var msg = "choose proper date-Start and end date is equal";
alert(msg);
return false;
}
if (document.example.opt2[3].checked && document.example.date2.value != "yyyy-mm-dd")
{
var msg="select only Start date- duration option not available";
alert(msg);
return false;
}
}
}
<FORM NAME="example" class="frm" onreset="disableField()" onSubmit="return checkForm(this);" action="a.php">
Please tell me when option4 radio button is selected and clicked the submit button it ahould open in another window.
And options 1,2,3 in same window