Abraham Olatubosun

Abraham Olatubosun

  • NA
  • 471
  • 107.1k

JAVASCRIPT NOT EXECUTING THE ELSE PART

Feb 17 2017 12:56 PM
My Code master,
 
Good day to you all, i have a JavaScript that test ASP.NET TextBox if it not empty,
if the TextBox is not empty it replace the value entered to it self else it should add the value entered to the existing value.
 below is my code
  1. var T797 = parseInt(document.getElementById('<%=TextBox797.ClientID%>').value);  
  2.               if (T797 !="" || T797 >= 0)  
  3.               {  
  4.                   document.getElementById('<%=TextBox797.ClientID%>').value = parseInt(document.getElementById('<%=TextBox651.ClientID%>').value);   
  5.               }else{  
  6.                   document.getElementById('<%=TextBox797.ClientID%>').value = parseInt(document.getElementById('<%=TextBox797.ClientID%>').value) + parseInt(document.getElementById('<%=TextBox651.ClientID%>').value);  
  7.               }  
please correct me where i am wrong
 
thank you 

Answers (4)