Esri / geoform-template-js

GeoForm is a configurable template for form based data editing of a Feature Service.
http://esri.github.io/geoform-template-js/
Apache License 2.0
67 stars 83 forks source link

Use input type for form fields to enable the proper keyboard #459

Closed davetimmins closed 9 years ago

davetimmins commented 9 years ago

It would be a nice enhancement to set the input type for the form fields to match the displayType that can be set in the field configuration. For example, if you currently have a field that allows the user to enter an email then the HTML tag currently gets output as

<input class="form-control" id="Email" aria-required="true" 
required="" type="text" maxlength="100" data-input-type="String" 
data-display-type="email">

so changing the type to be email rather than text would tell the browser to use the correct keyboard on mobile devices and show the @ symbol.

<input class="form-control" id="Email" aria-required="true" 
required="" type="email" maxlength="100" data-input-type="String" 
data-display-type="email">

This could also be useful for url input types and numeric input types so you present the user with a numeric keypad rather than the standard keyboard layout e.g. <input type="number" pattern="[0-9]*">

driskull commented 9 years ago

Thanks @davetimmins . We had tried this once before but I remember we ran into issues on some devices with keyboards. For numbers, I think we have to allow decimals as well. I'll look into it again and see what previous setback was.