Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 22, 2012 04:53 PM by roopeshreddy
Member
709 Points
1855 Posts
Dec 22, 2012 02:55 PM|LINK
Hi..
This is my javascript working fine
<script type="text/javascript"> function CheckVal1(){ if ($('[id*=Label8]').text() != (parseFloat($(".myclass1").text())+parseFloat($(".myclass2").text()))) { alert('Please Check Batch Pieces'); return false; } else return true ; } </script>
if .myclass2 is empty is not working why..?
All-Star
20143 Points
3327 Posts
Dec 22, 2012 04:53 PM|LINK
Hi,
Since the parseFloat() function is returning NaN, hence it's not working!!!
http://www.w3schools.com/jsref/jsref_parsefloat.asp
If the .myClass1 is empty or contains character in the text, then it returns NaN!
Hope it helps u...
Priya_here
Member
709 Points
1855 Posts
how to add my too footertable template gridview label value to compare with asp.net table
Dec 22, 2012 02:55 PM|LINK
Hi..
This is my javascript working fine
<script type="text/javascript"> function CheckVal1(){ if ($('[id*=Label8]').text() != (parseFloat($(".myclass1").text())+parseFloat($(".myclass2").text()))) { alert('Please Check Batch Pieces'); return false; } else return true ; } </script>if .myclass2 is empty is not working why..?
roopeshreddy
All-Star
20143 Points
3327 Posts
Re: how to add my too footertable template gridview label value to compare with asp.net table
Dec 22, 2012 04:53 PM|LINK
Hi,
Since the parseFloat() function is returning NaN, hence it's not working!!!
http://www.w3schools.com/jsref/jsref_parsefloat.asp
If the .myClass1 is empty or contains character in the text, then it returns NaN!
Hope it helps u...
Roopesh Reddy C
Roopesh's Space