onChange Validation
Posted: Fri Dec 30, 2005 1:42 am
Hi,
I have a form like this
So, in the first Form Area, i want to validate the user should enter Quantity & Price and Tag, before coming to next Form Area. i want this is happen onChange or some other event of input control 'Tag'. Becuase i will prefix Quantity to Tag.
i am able to validate onChange of Tag, but when Quantity & Price entered, the form should submit.
Any Ideas pls le me know.
Tq
I have a form like this
Code: Select all
function ValidateMe(thisform) {
if(thisform.Price.value==""){
alert("Enter Price");
thisform.Price.focus();
return false;
}
if(thisform.Quantity.value==""){
alert("Enter Quantity");
thisform.Quantity.focus();
return false;
}
if(thisform.Tag.value==""){
alert("Enter Tag");
thisform.Tag.focus();
return false;
}
thisform.submit(); // this line submits the form after validation
}
<form name="frm1" action="" method="post">
Quantity:<input name=Quantity>
Price: <input name=Price>
Tag: <input name="Tag" onChange="ValidateMe(frm1);return false;this.form.submit()">
</form>
<form name="frm2" action="AddValues.php" method="post">
<!-- Other Input Controls and in this place i will submit the form to next page-->
</form>i am able to validate onChange of Tag, but when Quantity & Price entered, the form should submit.
Any Ideas pls le me know.
Tq