Why is there no definition of .match is not a function

 
  var cashpledge=$("-sharpcashpledge").val();

 var reg = /^\+?(?!0+(\.00?)?$)\d+(\.\d\d?)?$/;
                var r = cashpledge.match(reg);
                if (r == null) {
                    alert("");
                } else {
                    window.location.href="__SELF__/cashpledge/"+cashpledge;
                }

clipboard.png

Mar.23,2021

is your cashpledge a number, or undefined, so there is no match method

Menu