preventDefault before modifying input value