I would like a simple form for an employee to enter an order ID. That ID would be validated from a second input. When it is validated it would be passed to the database through the insert.php
on the server.
Below is what I have written so far. I'm stumped on how to push the data on a successful check or clear the form on a fail.
<script type="text/javascript" language="JavaScript">
<!--
//--------------------------------
// This code compares two fields in a form and submit it
// if they're the same, or not if they're different.
//--------------------------------
function checkid(theForm) {
if (theForm.orderid1.value != theForm.orderid2.value)
{
alert('The two values don\'t match! Please check!');
return false;
} else {
return true;
}
}
//-->
</script>
<form action="../" onsubmit="return checkid(this);">
<form action="insert.php" method="post">
<p> Enter the compleated Order ID<br>
<input type="TEXT" name="orderid1" size="20" maxlength="20">
<br>
Please Confirm the order ID!
<br>
<input type="TEXT" name="orderid2" size="20" maxlength="20">
<br>
<input type="SUBMIT" value="Compleate Order!"></p>
</form>