Adds maxlength=1 attribute to all input fields using Javascript.