function inside onchange event not firing.

function inside onchange event not firing.

  1. $('#newPrice').change(function() {
                        this.value = this.value.replace(/[^0-9\.]/g,'');
                        checkPrice();
                    });


  2. function checkPrice () {
                    // any time the contents of the new price input field change check to make sure it's a valid change.'
                    alert('Checking Price');
                   
                }





Ok, so the above code will do the regex when the contents of the textbox changes, but it does not seem to call the checkPrice function I've placed after it does the regex.

I have the above on Change code in a .keyup event and it works as expected.

O.