Couple of simple options;
- Change the type from button to submit
- or place
document.myform.submit();
before return true;
(change myForm to the name of the form)
-- EDIT --
Do option 1. change the type of the button from button to submit and it works.
<html>
<head>
<title>Title</title>
<script type="text/javascript">
function chkvalid()
{
if(document.getElementById("Date").value=="" && document.getElementById("ddlModel").value=="0")
{
alert("he");
return false;
}
else
{
return true;
}
}
</script>
</head>
<body>
<form action="viewrecords.asp" method="post">
Date<input type="text" id='Date'/><BR>
<input type="text" id='ddlModel'/><BR>
<input value="Show" onclick="return chkvalid();" type="submit" />
</form>
</body>
</html>