mirror of
https://github.com/internetee/registry.git
synced 2025-05-30 17:33:57 +02:00
Relax email inputs on client side #2855
This commit is contained in:
parent
d5563a4d2b
commit
af6f3bc87e
4 changed files with 11 additions and 8 deletions
|
@ -18,3 +18,6 @@ $.validator.setDefaults
|
|||
error.insertAfter element
|
||||
return
|
||||
|
||||
jQuery.validator.addMethod 'lax_email', ((value, element) ->
|
||||
@optional(element) or (value.match(new RegExp("@", "g")) || []).length == 1
|
||||
), 'Please enter a valid email address.'
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
.col-md-4.control-label
|
||||
= f.label :email
|
||||
.col-md-8
|
||||
= f.text_field(:email, class: 'form-control', email: true)
|
||||
= f.text_field(:email, class: 'form-control', lax_email: true)
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :country_code, t(:country)
|
||||
|
|
|
@ -31,12 +31,12 @@
|
|||
.col-md-4.control-label
|
||||
= f.label :email
|
||||
.col-md-7
|
||||
= f.text_field(:email, class: 'form-control', email: true)
|
||||
= f.text_field(:email, class: 'form-control', lax_email: true)
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= f.label :billing_email
|
||||
.col-md-7
|
||||
= f.text_field(:billing_email, class: 'form-control', email: true)
|
||||
= f.text_field(:billing_email, class: 'form-control', lax_email: true)
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
.col-md-3.control-label
|
||||
= f.label :email, t(:email) + '*'
|
||||
.col-md-7
|
||||
= f.text_field :email, class: 'form-control', required: true, email: true
|
||||
= f.text_field :email, class: 'form-control', required: true, lax_email: true
|
||||
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue