oninput="this.value = this.value.replace(/[^-0-9.]/g, '')
This code snippet is utilized in my current project. However, there seems to be an issue where the input can contain more than one minus sign, as shown here:
---23
To address this problem, I would like to set the following conditions for my input field:
- It should only accept positive and negative numbers.
- There should be at most zero or one minus sign allowed.