You can do the validation two ways. Through JavaScript or through ASP. The problem with JavaScript is that someone can turn it off. ASP they cannot. Through JavaScript, you put an onSubmit() handler in the <form> tag. When your form is submit, onSubmit is caught and your code executed. Returning a true or false to the onSubmit will either stop the submit, or allow it to continue:
<form name="myform" action="mypage.asp" method="post" onSubmit="return checkForm();">
Now you need to create a function to check your values:
Code:
<script language="javascript">
function checkForm(){
// Check the form values here to make sure they meet your criteria
// If the fields pass do:
return true;
// If the fields fail do:
return false;
}
</script>
This will return true or false back to the first return statement which returns true or false back to the onSubmit, telling the form to go or not.
Now, you can also do this in ASP, and just check the values after the submit. If the values fail, you redisplay the form with the values they typed in and mark the field that failed the test.
As for popup windows, it's the window name attribute of the window.open function.
Code:
window.open('mypage1.asp', 'myWindow', '');
window.open('mypage2.asp', 'myWindow', '');
window.open('mypage3.asp', 'myWindow', '');
Now all three pages should load in the same window.