Remove the assumption that the field is still a text field.

The Javascript assums that the field is still a text field. This prevents another Javascript from changing the field to "url" or "email" or "tel" or even "hidden".