NEED HELP IN FIXING A CODE



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>

.



Relevant Pages

  • Re: AWK problem need help
    ... The script is as follows: ... printf ("PAT:%s\n", $prev) ... The latter would print the field at whatever position "var" contains, and the whole record if var is zero or unset. ... Also, you don't need the " " as the final argument to splitas that's the default, and awk arrays start at 1, not 0 so "lastline" will always be empty. ...
    (comp.unix.shell)
  • Re: how to send mail within a script ?
    ... >I am trying to write a script which will send the ... >result of a var to mail web mail.this is what I wrote ... Prev by Date: ...
    (perl.beginners)
  • [CORRECTIONS AND ADDITIONS ]Azbb v1.1.00 Cross-Site Scripting
    ... variable upon submission to the post.php script via the POST method. ... Prev by Date: ...
    (Bugtraq)
  • Why doesnt this work in Firefox?
    ... Here's a simple script to update the contents of one select based on ... function AddItem(){ ... Prev by Date: ...
    (comp.lang.javascript)
  • Re: Variables in Matlab Script
    ... > I then access the actual variable with my script? ... var = evalin; ... ferry. ... Prev by Date: ...
    (comp.soft-sys.matlab)

Loading