Add pattern to input elements