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
- var T797 = parseInt(document.getElementById('<%=TextBox797.ClientID%>').value);
- if (T797 !="" || T797 >= 0)
- {
- document.getElementById('<%=TextBox797.ClientID%>').value = parseInt(document.getElementById('<%=TextBox651.ClientID%>').value);
- }else{
- document.getElementById('<%=TextBox797.ClientID%>').value = parseInt(document.getElementById('<%=TextBox797.ClientID%>').value) + parseInt(document.getElementById('<%=TextBox651.ClientID%>').value);
- }
please correct me where i am wrong
thank you


Nilesh ShahRank #42 · 34.2K reputationPosted Feb 17, 2017, 1:01 PM EST
Bryian TanRank #396 · 6.3K reputationPosted Feb 17, 2017, 10:04 AM EST
Abraham OlatubosunRank #2,749 · 510 reputationPosted Feb 17, 2017, 12:26 PM EST
Nilesh ShahRank #42 · 34.2K reputationPosted Feb 17, 2017, 10:46 AM EST