Hello i have the following input :
<input type="text" name="morningS" id="morningS" pattern="[0-23] ,[00|25|50|75]$"/>
im trying to limit it to something like this : "the numbers before the ',' should be between 0 and 23 only and the number after can only be "00" "25" "75" or "50" but the pattern i added isnt working , anyone can help please ?
CodePudding user response:
This seems to do the trick...
<input type="text" name="morningS" id="morningS" required pattern="^[0-23] ,(00|25|50|75)$" title="Format should be 0-23 followed by a comma, then one of 00, 25, 50, or 75"/>
Essentially I just changed the square brackets to regular ones. I also added a title attribute to enable browsers that support it to describe the required pattern to users.