<script type="text/javascript">
function gridSaveClick()
{
var MyGrid = document.getElementById('ctl00_ContentPlaceHolder_ID');
var count;
var num;
var checkCount = 0;
for (var a = 1; a < MyGrid.rows.length; a++)
{
count = MyGrid.rows[a].cells[0];
for (var j = 0; j < count.childNodes.length; j++)
{
num = a + 1;
if (num < 10) num = "0" + num;
var lbnSave = "ctl00_ContentPlaceHolder_ ID " + num + "_lbnEditPFI";
if (document.getElementById(lbnSave).innerHTML == "Save")
{
var MaturityDate = "ctl00_ContentPlaceHolder_ ID " + num + "_txt";
var InvestmentDate = "ctl00_ContentPlaceHolder_ ID " + num + "_txt";
var InvestmentType =
"ctl00_ContentPlaceHolder_gvwPriFunInvReport_ctl" + num + "_txtf";
var Institute =
"ctl00_ContentPlaceHolder_gvwPriFunInvReport_ctl" + num + "_ddl";
var Status =
"ctl00_ContentPlaceHolder_gvwPriFunInvReport_ctl" + num + "_ddlStatus";
var ActiveInvestment =
"ctl00_ContentPlaceHolder_gvwPriFunInvReport_ctl" + num + "_txtAs";
var InterestRate =
"ctl00_ContentPlaceHolder_gvwPriFunInvReport_ctl" + num + "_txtIn";
if (document.getElementById(InvestmentDate).value == "")
{
alert('Enter Date Of Investment');
document.getElementById(InvestmentDate).focus();
return false;
}
else if (document.getElementById(MaturityDate).value == "")
{
alert('Enter Date Of maturity');
document.getElementById(MaturityDate).focus();
return false;
}
if (DDValidation(document.getElementById(InvestmentDate).value, document.getElementById(MaturityDate).value) == false)
return false;
if (document.getElementById(InvestmentType).value == "")
{
alert('Enter Investment Type');
document.getElementById(InvestmentType).focus();
return false;
}
else if (document.getElementById(Institute).selectedIndex == 0)
{
alert('Select Where Invested');
document.getElementById(Institute).focus();
return false;
}
else if (document.getElementById(Status).selectedIndex == 0)
{
alert('Select Investment Matured Or Sold');
document.getElementById(Status).focus();
return false;
}
else if (document.getElementById(ActiveInvestment).value == "")
{
alert('Enter Active Investments');
document.getElementById(ActiveInvestment).focus();
return false;
}
else if (document.getElementById(InterestRate).value == "")
{
alert('Enter Interest Rate');
document.getElementById(InterestRate).focus();
return false;
}
}
}
}
}
</script>
No comments:
Post a Comment