Math_app project

I’m working in the inputCapture.js file in the github project here => math_app

Install node modules and run the project with npm start.
I’m trying to capture the input immediately and move it through validation. Unfortunately the input is always a step behind what the user has written.

If the user enters 1 the console logs ‘’
If the user enters 18 the console logs ‘1’ etc

I want the validation to be automatic, not on keypress.

This is the biggest problem, although there are other problems. Can anyone tell me if there is a way to correct this browser lag? Would love for the user to type in the answer and for it to be validated.

Hi Randall thanks for your response.

I have a large number (always top) and a small number.
When the user adds the top and bottom digit an if statement will check if the answer matches the addition of the large and small unit. If true it will run the code. Currently that isn’t happening. I believe that when the user has typed in the value, the browser doesn’t validate until the the enter key is pressed. When the enter key is pressed the value is updated…

Eg.

 52
+13

user types in 5 in digit input and the tens input opens up.

  47
+ 27

User types in 14 in the input, the 1 gets carried leaving the 7 in the digit input and opening up the 10s input…

It’s almost there. I was using the enter key which was fine, but it wasn’t validating as the user went and I thought it might be better to validate step by step without the user having to press enter…

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.