0
   

Javascript function if , else conditions

 
 
grk2368
 
Reply Sat 19 Nov, 2016 10:09 am
I am new to programming, I have created following Javascript function from scratch. But, it not executing correctly.It has some errors,but,I can't clear the errors.please help me,

<script type = "text/javascript">
function GetSelectedRow(lnk) {
var row = lnk.parentNode.parentNode;
if (row.cells[0].innerHTML == "checkbox")
{
var ItemCode = row.cells[1].innerHTML;
var ItemName = row.cells[2].innerHTML;
var Unit = row.cells[3].innerHTML;
var Price = row.cells[4].innerHTML;
var StockQty = row.cells[5].innerHTML;
document.getElementById('<%=TxtICode.ClientID %>').value = ItemCode;
document.getElementById('<%=TxtIName.ClientID %>').value = ItemName;
document.getElementById('<%=DropDownUnit.ClientID %>').value = Unit;
document.getElementById('<%=TxtPrice.ClientID %>').value = Price;
document.getElementById('<%=TxtStockQty.ClientID %>').value = StockQty;
return false;

}
else (row.cells[0].innerHTML != checkbox)
{
var ItemCode = row.cells[0].innerHTML;
var ItemName = row.cells[1].innerHTML;
var Unit = row.cells[2].innerHTML;
var Price = row.cells[3].innerHTML;
var StockQty = row.cells[4].innerHTML;
document.getElementById('<%=TxtICode.ClientID %>').value = ItemCode;
document.getElementById('<%=TxtIName.ClientID %>').value = ItemName;
document.getElementById('<%=DropDownUnit.ClientID %>').value = Unit;
document.getElementById('<%=TxtPrice.ClientID %>').value = Price;
document.getElementById('<%=TxtStockQty.ClientID %>').value = StockQty;
return false;
}

}
</script>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 567 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » Javascript function if , else conditions
Copyright © 2019 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 06/17/2019 at 11:11:43