deptofdefense / move.mil

The entry point website to the Defense Personal Property System (DPS).
https://www.move.mil
Other
15 stars 15 forks source link

Numeric-only inputs #417

Closed jamesatheyDDS closed 6 years ago

jamesatheyDDS commented 6 years ago

Addresses #374.

Checklist

I have…

Summary of Changes

This pull request sets the apporpriate attributes on the PPM Estimator and Weight Estimator forms so that mobile browsers will get the numeric-only keyboard when entering quantities, ZIP codes, dates, and weights.

Testing

To verify the changes proposed in this pull request…

  1. clone this repo,
  2. git checkout numeric-only-inputs,
  3. set up development dependencies according to CONTRIBUTING.md,
  4. run bin/rails server, and
  5. load up http://localhost:3000 in the Web browser of your choice.

Screenshots

PPM Estimator - zip code field - before (iOS Safari) ![img_2697c1814ece-1](https://user-images.githubusercontent.com/26554826/38832629-27f0515c-4191-11e8-9189-44a4fa1ff4ff.jpeg)
PPM Estimator - zip code field - after (iOS Safari) ![img_ddce3b3e48e1-1](https://user-images.githubusercontent.com/26554826/38832634-2d385a6a-4191-11e8-821f-17fce955ca90.jpeg)
Weight Estimator - quantity field - before (iOS Safari) ![img_d8767e3d230a-1](https://user-images.githubusercontent.com/26554826/38832638-32146902-4191-11e8-8af8-b9d301d9ba6a.jpeg)
Weight Estimator - quantity field - after (iOS Safari) ![img_bd6a817cadd0-1](https://user-images.githubusercontent.com/26554826/38832642-36778a9c-4191-11e8-8285-20b7b62ff57c.jpeg)
jgarber623-gov commented 6 years ago

Regarding ZIP entry, a few questions:

jamesatheyDDS commented 6 years ago

@jgarber623-gov

Will these changes prevent users from entering postal codes that aren't entirely numeric (thinking OCONUS off-base postal codes, specifically)?...and/or do we support calculations in regions where postal codes aren't entirely numeric (and five-digit based on the constraints)?

The estimator does not support OCONUS locations at all at the moment. The constraint was 5 digits before this PR as well, this just lets iOS and Android browsers detect that the field is numeric correctly.

Do these form fields that are now of type="number" continue to function with leading-zero ZIP codes (e.g. 08904)?

I just tested the ZIP code 06511 with both Chrome and IE11, and it worked in both browsers.