Javascript defaultValue

For some reason I have never needed to use the defautlValue property up until today. ¬†I was pleased to find javascript can access the original input value so tracking changes in a form is a bit easier. ¬†However, the defaultValue only works as expected for “text”, “file”, and “password” fields.

A workaround is to use type=”text” and just have a style=”display:none;” to act like a hidden field.

Tagged with: ,

Leave a Reply

Your email address will not be published. Required fields are marked *