﻿// JScript File
    function ltrim(str) { 
	    for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
	    return str.substring(k, str.length);
    }
    function rtrim(str) {
	    for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
	    return str.substring(0,j+1);
    }
    function trim(str) {
	    return ltrim(rtrim(str));
    }

    function checkNumeric() {
        var anum=/(^\d+$)|(^\d+\.\d+$)/; 
        var vWTfrom=document.getElementById('txtWeightFrom').value;
        var vWTto=document.getElementById('txtWeightto').value;
        if (trim(vWTfrom)!="")
        {
            if (anum.test(vWTfrom))
            {
                //return true;
            }
            else
            {
                alert('Please enter numeric value weight from');
                return false;
            }
        }
        
        if (trim(vWTto)!="")
        {
            if (anum.test(vWTto))
            {
                //return true;
            }
            else
            {
                alert('Please enter numeric value weight to');
                return false;
            }
        }
        return true;
      }

