It seems like there may be a null pointer exception occurring and there are no errors being displayed on your browser.
To troubleshoot, you can try the following code snippets:
alert(document);
alert(document.dd);
alert(document.dd.begin);
alert(document.dd.begin.checked);
alert(document.dd.end);
alert(document.dd.end.checked);
If you receive 'undefined' from any of these alerts, it indicates that there may be issues in your code execution.
Additionally, make sure to read through the other answers provided here for more insights.
Another approach is to wrap your code in a try/catch block and display the error using alerts:
function valid(){
try{
begin_checked = false;
end_checked = false;
alert("begin_checked: " +begin_checked);
alert("end_checked: " +end_checked);
if (document.dd.begin.checked.length == undefined || document.dd.end.checked.length == undefined ){
alert("In undefined");
}
alert("end");
} catch (e) {
alert(e);
}
}