Hello,
I am new to JavaScript and I am looking for a function that will check a user's input and changing that input if necessary.
i.e.
there is a form field with an initial value of 1, if the user chooses to change the number it can only be numbers from 1-10. I would like onblur for the function to run and if the number entered was greater than 10 the value defaults to 10 or if the number entered is 0 it defaults to 1.
I don't have any code to show as I don't know where to start with it.
Thanks in advance for your help.
I am new to JavaScript and I am looking for a function that will check a user's input and changing that input if necessary.
i.e.
there is a form field with an initial value of 1, if the user chooses to change the number it can only be numbers from 1-10. I would like onblur for the function to run and if the number entered was greater than 10 the value defaults to 10 or if the number entered is 0 it defaults to 1.
I don't have any code to show as I don't know where to start with it.
Thanks in advance for your help.