Abraham Olatubosun

Abraham Olatubosun

  • NA
  • 471
  • 107.3k

How check if a textbox contain a value using JavaScript

Feb 14 2017 7:22 PM
Dear Code Masters,
    Greetings to you all and happy Valentine day, love, joy and good health to you all.
Code Masters, i writing a project for my organisation whee we collect data this data's are aggregated before submitting to the server.
    So, i want to test each aggregated TextBox if the contain Value then that should be added as well else the current data will be summ to the aggregate TextBox. The code below is it correct Please:
  1. function sumUpHTC20() {  
  2.               if (isNaN(parseFloat(document.getElementById('<%=TextBox1070.ClientID%>').value))) {  
  3.                   document.getElementById('<%=TextBox1069.ClientID%>').value = parseFloat(document.getElementById('<%=TextBox1070.ClientID%>').value) + 10  
  4.               } else {  
  5.                   document.getElementById('<%=TextBox1069.ClientID%>').value = parseFloat(document.getElementById('<%=TextBox1070.ClientID%>').value) + parseFloat(document.getElementById('<%=TextBox1071.ClientID%>').value);  
  6.               }  
  7.           }  
it not working, kindly review.
Thank you all 

Answers (2)