i have three following functions i want to attach on same even how ic an do it?
function 1:
function ValidateFormWithGrid()
{
var isValidate = true;
var objProductLine = document.getElementById("<
%=comboPod
uctLine.Cl
ientID%>")
if (objProductLine!=null)
{
if (objProductLine.value==-1)
{
alert("Please select Product Line");
objProductLine.focus();
isValidate = false;
return isValidate;
}
}
var objCatalogNumber = document.getElementById("<
%=comboCat
.ClientID%
>")
var objTextCatalogNumber = document.getElementById("<
%=txtCatal
ogNumber.C
lientID%>"
)
if (objCatalogNumber!=null)
{
if (objCatalogNumber.value==-
1 && objTextCatalogNumber.value
=='' )
{
alert("Please select/search Cat#");
objCatalogNumber.focus();
isValidate = false;
return isValidate;
}
}
if(checkBoxes!=null)
{
for (index = 0; index < checkBoxes.length; index++)
{
if (checkBoxes[index].checked
&& textBoxes[index].value != '')
{
return isValidate;
}
}
alert('Please select Cat# and enter Recommended Units.');
isValidate = false;
return isValidate;
}
}
function 2 :
function ValidateRequiredUnits()
{
for (index = 0; index < checkBoxes.length; index++)
{
if (checkBoxes[index].checked
&& textBoxes[index].value == '')
{
alert('Please enter Recommended Units for all selected items.');
return false;
}
}
return true;
}
function 3
function ValidateValueOfUnitRequest
ed()
{
for (index = 0; index < checkBoxes.length; index++)
{
if (checkBoxes[index].checked
&& (parseFloat(textBoxes[inde
x].value) < 1))
{
alert('Units requested should be greater than or equal to 1.');
return false;
}
}
return true;
}
event is following :
BtnSave.Attributes.Add("On
Click", "return (ValidateFormWithGrid())")
;
Start Free Trial