I need to combine these 2 patterns together or use them both in my <input> field
I have pattern matching to check for a valid time - which works great and the field is "NOT REQUIRED" so we will accept a blank field
pattern="([01]?[0-9]|2[0-3])[0-5][0-9]"
I also want to use this pattern to allow null values OR a max and min length of only 4 characters...
pattern=".{0}|.{4,4}"
I also have maxlength set - might be redundant
maxlength="4"
So basically I need a fixed character length (time as HHMM) of 4 characters or null - nothing in between....
I would have just been happy to use minlength but am receiving conflicting reports about its acceptance among browsers...
<input type="text" name="movie" maxlength="4" pattern="([01]?[0-9]|2[0-3])[0-5][0-9]" pattern=".{0}|.{4,4}" value='<?php echo $objResult["MOVIE"]; ?>'>
pattern="((?=.{4}$)([01]?[0-9]|2[0-3])[0-5][0-9]|)".