G
Gary Vidal
I have a client side Javascript which checks an OrderQuantityField against a hidden Textbox of the Minimum Order Quantity. I dont want to do validation on a postback. I would like to be able to have FormValidate Javascript function postback to my addToCart Method in my code behind
function ValidateForm(myform) {
if (myform.OrderQuantity.value == 0) {
alert("Form is Invalid = 0 " + myform.OrderQuantity.value); return false
}
if (parseInt(myform.OrderQuantity.value,10) >= parseInt(myform.MinQuantity_Hidden.value,10)) {
}
else { alert("Order Quantity must be greater than " + myform.MinQuantity_Hidden);
myform.OrderQuantity.focus() return false
}
if (parseInt(myform.OrderQuantity.value,10) % parseInt(myform.MinQuantity_Hidden.value,10))
{ alert("Order Quantity must be in multiples of " + myform.MinQuantity_Hidden.value);
myform.OrderQuantity.focus()
return false
}
//Some code here to post back to the server method??
return true
}
function ValidateForm(myform) {
if (myform.OrderQuantity.value == 0) {
alert("Form is Invalid = 0 " + myform.OrderQuantity.value); return false
}
if (parseInt(myform.OrderQuantity.value,10) >= parseInt(myform.MinQuantity_Hidden.value,10)) {
}
else { alert("Order Quantity must be greater than " + myform.MinQuantity_Hidden);
myform.OrderQuantity.focus() return false
}
if (parseInt(myform.OrderQuantity.value,10) % parseInt(myform.MinQuantity_Hidden.value,10))
{ alert("Order Quantity must be in multiples of " + myform.MinQuantity_Hidden.value);
myform.OrderQuantity.focus()
return false
}
//Some code here to post back to the server method??
return true
}