Don't rely on how the type in an input field is set.

The type in an HTML form could be set upper case. In this case the code
seem to work fine, but doesn't set any value in the input field. This
commit takes these cases in consideration and fixes #117