samedi 2 mai 2020

how to make the input value back to the original value when using oninput="validity.valid||(value=' ');" instead of empty input slot

The code makes the input slot empty when pressing "-", "+" or any special character in input field. Example: When i type 123 and "-" in the slot ass soon as I press "-" the input field value becomes empty what I want is the input fields value to be back to 123 instead of empty .

<input type="number" value="1" min="1" id="quantity2" oninput="validity.valid||(value='');">



Aucun commentaire:

Enregistrer un commentaire