proper pagination detection
fix js for multiple inputs on a page