Update input.js

I was off by one with my checks for disabling the buttons. It was changing the page number before I did the check, not after.