added validation with jquery-validate on signup page
This commit is contained in:
@ -7,6 +7,17 @@ body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.help-block.error,
|
||||
label.error {
|
||||
color: #e74c3c;
|
||||
}
|
||||
|
||||
.form-control.error,
|
||||
.form-control.error:focus {
|
||||
border: 2px solid #e74c3c;
|
||||
}
|
||||
|
||||
|
||||
.btn-label {
|
||||
position: relative;
|
||||
left: -12px;
|
||||
|
2
public/js/lib/jquery.validate.js
vendored
Normal file
2
public/js/lib/jquery.validate.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
public/js/main.js
Normal file
3
public/js/main.js
Normal file
@ -0,0 +1,3 @@
|
||||
/* global $ */
|
||||
|
||||
$('form').validate();
|
@ -43,5 +43,7 @@ html
|
||||
a(href='/logout') Logout
|
||||
.container
|
||||
block content
|
||||
|
||||
script(src='/js/lib/jquery.js')
|
||||
script(src='/js/lib/jquery.validate.js')
|
||||
script(src='/js/main.js')
|
||||
|
@ -7,19 +7,19 @@ block content
|
||||
.form-group
|
||||
.row
|
||||
.col-xs-6.col-sm-6.col-md-6
|
||||
label(for='firstName') First Name
|
||||
label.control-label(for='firstName') First Name
|
||||
input.form-control(type='text', name='firstName', id='firstName', placeholder='First Name', autofocus='', required='')
|
||||
.col-xs-6.col-sm-6.col-md-6
|
||||
label(for='lastName') Last Name
|
||||
label.control-label(for='lastName') Last Name
|
||||
input.form-control(type='text', name='lastName', id='lastName', placeholder='Last Name', required='')
|
||||
.form-group
|
||||
label(for='email') Email
|
||||
label.control-label(for='email') Email
|
||||
input.form-control(type='email', name='email', id='email', placeholder='Email', required='')
|
||||
.form-group
|
||||
label(for='password') Password
|
||||
label.control-label(for='password') Password
|
||||
input.form-control(type='password', name='password', id='password', placeholder='Password', required='')
|
||||
.form-group
|
||||
label(for='confirmPassword') Confirm Password
|
||||
label.control-label(for='confirmPassword') Confirm Password
|
||||
input.form-control(type='password', id='confirmPassword', placeholder='Confirm Password', required='')
|
||||
.form-group
|
||||
button.btn.btn.btn-primary(type='submit') Signup
|
||||
@ -28,5 +28,3 @@ block content
|
||||
.alert.alert-danger
|
||||
for message in messages
|
||||
div= message
|
||||
script
|
||||
$('form').validate();
|
||||
|
Reference in New Issue
Block a user