A
alec
Hello,
Below is the sample and simple code that checks the form before submission:
if week day is Sunday, nothing happens. On any other day form is submitted.
Question: this script works for client side validation. Could anybody please
show me what changes should be done in a code so that form would be checked
on the server side.
Thank you.
<html>
<head>
<script>
var today = new Date()
var weekdaynumber=today.getDay()
function DoSubmit()
{
if (weekdaynumber = 1)
{
window.alert("Today is Sunday")
}
else
{
window.open( "","new_window", "width=618, toolbar=0, menuebar=0, status=0,
height=700, scrollbars=1, resizable=0, top=0, left=0");
document.order_form.target="new_window";
document.order_form.action="confirmation_form.asp";
document.order_form.submit();
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form method="POST" name="order_form">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><input type="text" name="FirstName" size="20"></p>
<p><input type="text" name="LastName" size="20"></p>
<p> </p>
<span style="cursor:hand" onclick="DoSubmit()">Click here to submit</span>
</form>
</body>
</html>
Below is the sample and simple code that checks the form before submission:
if week day is Sunday, nothing happens. On any other day form is submitted.
Question: this script works for client side validation. Could anybody please
show me what changes should be done in a code so that form would be checked
on the server side.
Thank you.
<html>
<head>
<script>
var today = new Date()
var weekdaynumber=today.getDay()
function DoSubmit()
{
if (weekdaynumber = 1)
{
window.alert("Today is Sunday")
}
else
{
window.open( "","new_window", "width=618, toolbar=0, menuebar=0, status=0,
height=700, scrollbars=1, resizable=0, top=0, left=0");
document.order_form.target="new_window";
document.order_form.action="confirmation_form.asp";
document.order_form.submit();
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<form method="POST" name="order_form">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><input type="text" name="FirstName" size="20"></p>
<p><input type="text" name="LastName" size="20"></p>
<p> </p>
<span style="cursor:hand" onclick="DoSubmit()">Click here to submit</span>
</form>
</body>
</html>