Client-side validate phone number fields
This commit is contained in:
parent
bd1bcf51e9
commit
c8610caa54
|
@ -39,7 +39,7 @@ telephoneField = Field
|
||||||
, fieldView = \id name otherAttributes result isRequired ->
|
, fieldView = \id name otherAttributes result isRequired ->
|
||||||
let result' = either (\x -> x) renderPhoneNumber result
|
let result' = either (\x -> x) renderPhoneNumber result
|
||||||
in [whamlet|
|
in [whamlet|
|
||||||
<input type="tel" id="#{id}" name="#{name}" value="#{result'}" *{otherAttributes} :isRequired:required="true">
|
<input type="tel" id="#{id}" name="#{name}" value="#{result'}" pattern="[+ 0123456789]*" title="Only '+', spaces and numbers are allowed" "*{otherAttributes} :isRequired:required="true">
|
||||||
|]
|
|]
|
||||||
, fieldEnctype = UrlEncoded
|
, fieldEnctype = UrlEncoded
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue