Make sure input is a number before making an AJAX call