I have a text input for a calculator that is already set up to only accept numbers, and I want to allow for both positive and negative integers, but when the input is used, I want to disallow + and - to be entered. Instead, I want to have those inputs cause operations to be performed.
display.keypress(function() {
if (temp === 0 && $(this).val().isInteger()) {
temp = $(this).val().toString();
} else if ($(this).val().isSafeInteger()) {
temp += $(this).val().toString();
}
});