Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
this is my code
C#
<script type="text/javascript">
     function ValidateAddOnModule(source, args) {
         var gdv = document.getElementById('ContentPlaceHolder1_MainContent_grdAddonModules');

         var j = 0;
         var k = 0;
         for (var i = 1; i <= gdv.rows.length - 1; i++) {
             var img = document.getElementById('ContentPlaceHolder1_MainContent_grdAddonModules_ImgLanUserError_' + j);
             var LANUser = document.getElementById('ContentPlaceHolder1_MainContent_grdAddonModules_txtAdditionalLANUser_' + j).value;
             var MinLANUser = gdv.rows(i).cells(2).innerText;
            // alert(MinLANUser);
           //  alert(LANUser);
             if (MinLANUser != " ")
             {

                 if (MinLANUser <= LANUser) {
                     alert("true");
                     img.style.visibility = "hidden";
                 }
                 else {
                     alert("false");
                     img.style.visibility = "visible";
                     k = 1;
                 }
                 j++;
             }
         }


         if (k = 1) {
             return false;

         } else
         {

             return true;
         }


    }

</script>
Posted
Comments
ArunRajendra 5-Jan-15 2:20am    
Can you post the values your are getting for LANUser & MinLANUser
JR009 5-Jan-15 2:21am    
Where is the error? Are you getting values in all variables? Please explain, what are you getting right now and what you want?

First Check that the values are coming in both the variable if values are coming then use

if(parseFloat(MinLANUser) <= parseFloat(LANUser)
{
}
 
Share this answer
 
Comments
SathishRam 5-Jan-15 5:16am    
Tan Q
C#
var LANUser = parseInt(document.getElementById('ContentPlaceHolder1_MainContent_grdAddonModules_txtAdditionalLANUser_' + j).value);

var MinLANUser = parseInt(gdv.rows(i).cells(2).innerText);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900