I want to check some Textbox control if they have value do some addition else do assignment, I used the JQuery script below it didn't work for me.
The idea is on key up it should call the JQuery Function to check if TextBox797 have value then sum up the value of TextBox651 and TextBox797 else replace the value of TextBox797 with value of TextBox651. it not showing any result
- <ASP:TextBox ID="TextBox651" runAt="server" onKeyUp="CheckIT()" />
-
- <ASP:TextBox ID="TextBox797" runAt="server" />
this is the JQ script i have in the Function
- function CheckIT()
- {
- if ($('#<%=TextBox797.ClientID%>').val() != ""
- && $('#<%=TextBox797.ClientID%>').val() >= 0) {
-
- document.getElementById('<%=TextBox797.ClientID%>').value =
- parseInt(document.getElementById('<%=TextBox797.ClientID%>').value) +
- parseInt(document.getElementById('<%=TextBox651.ClientID%>').value);
-
- } else {
-
- document.getElementById('<%=TextBox797.ClientID%>').value =
- parseInt(document.getElementById('<%=TextBox651.ClientID%>').value);
-
- }
-
- }
please is their any other way to write the JQuery to do the job ?
Thank you