I am trying to create a regular expression javascript function to check and format the time of 24 hours, accept time without a semicolon and remove spaces.
Examples:
If the user dials "0100" , " 100" or "100 " , he will be accepted, but formatted at "01:00"
If the user dials "01:00" , he will be accepted, without the need for formatting.
Thanks.
javascript function regex validation time
Amra
source share