How do I only allow roman numerals characters to be typed in this input? Please comment if I am missing something when asking the question.
<label for="rtnInput">Enter Roman Numeral:</label>
<input type="text" id="rtnInput">
How do I only allow roman numerals characters to be typed in this input? Please comment if I am missing something when asking the question.
<label for="rtnInput">Enter Roman Numeral:</label>
<input type="text" id="rtnInput">
If you're using the html attribute pattern
for input/form validation, you can pass a regex to pattern like so:
<input type="text" id="rtnInput" pattern="^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$" />
referencing the roman numeral regex found here: https://stackoverflow.com/a/267405/5912253
The only thing I could think of right now is a drop down menu
<select name="number" id="RNumbers">
<option value="I"> I </option>
<option value="II"> II </option>
<option value="III"> III </option>
<option value="IV"> IV </option>
<option value="V"> V </option>
</select>