• 5 min read

Why My Number Fields Changed What People Typed

A number field should let you finish the number. Some ToolGrit fields were changing it after each key, which produced answers the user hadn't asked for. One bug report exposed the same mistake across twenty calculators.

A report I could reproduce

Someone used my contact form to report two fields on the cathodic protection calculator. Pipe footage and available voltage wouldn't accept the values. When I tried them, entering 1500 ended at 500000. Entering 12.5 ended at 100.

This was part of the work described in my September 29, 2026 post. ToolGrit is my collection of trade calculators. Its public tools are free to use without signing in.

The field was correcting an unfinished number

The compressed air pressure field makes the mistake easy to see. It had a minimum of 50. Here's what happened when I typed 120:

  1. The first key was 1. The field immediately replaced it with 50.
  2. The next key was 2. That appended to the replacement, making 502.
  3. The last key was 0. The displayed value became 5020.

The limit wasn't the trouble. Applying it halfway through typing was. A value can be incomplete for a moment without being the value someone wants to submit.

Other fields showed related failures. Backspace restored a number instead of clearing it. A typed zero vanished, preventing 0.5. The weld calculator lost the decimal point in 22.5 volts.

The mini-split temperature fields rejected a minus sign. That's inconvenient in North Dakota. In some generator loads, typing running watts raised surge watts, but deleting a digit didn't lower it again.

One shared fix, with a catch of its own

I searched the other calculators for that pattern. The fix ultimately covered twenty, including compressed air, conduit fill, water heater sizing and lift station runtime.

I wrote a shared number field, plus a version that permits an empty value. It leaves the typed text alone while you edit. It checks a changed value when you click away or press Enter.

After that check, the field shows the value the calculator actually kept. A limit may still apply. The important part is that typing isn't interrupted and the displayed value tells the truth.

My first fix still mishandled an untouched field. A lift station generator value was 0, while its minimum was 1. Focusing it and leaving changed it to 1, which changed the runtime result.

I caught that before migrating the lift station fields. The shared field now commits only after an edit. Passing through an unchanged field preserves the stored value, even when it falls outside the current limits.

For that repair, each field had automated browser checks at desktop and phone widths. The original checks covered typing, clearing, leaving untouched, Enter and reloading.

The ToolGrit home page: the headline Trade calculators for field math that needs to be right, a search box for tools, and cards for electrical run, shop feed and grain handling checks
The ToolGrit home page, from earlier this summer. The count has gone up since.

Check the fields your customers use

The same design mistake can affect a quote or order form. I know one person reported my bug. I don't know how many other people gave up without reporting it.

  1. Open an important form on a phone, then on a computer.
  2. Type a normal phone number, ZIP code or quantity. Watch whether the field changes it before you're finished.
  3. Erase the entry and replace it. Check that Backspace doesn't bring the old value back.
  4. Try zero, a decimal and a negative number where those values are valid for the field.
  5. Leave the field, then return. Check that it kept your entry or explained why it couldn't accept it.

If you find a problem, fix that field before deciding the whole site needs replacing. A small form repair can make an existing page usable again.

Try a field with real numbers

Open a ToolGrit calculator for a job you know. Clear a value, enter your own and check what stays after you leave.

About Ben Huffman

Ben Huffman runs Dirt River Design, a one-person web shop in Grand Forks, North Dakota. He builds fast, plain websites for local businesses and runs ToolGrit, a free library of trade calculators.

More about Ben →