Commit ebc0974d by chenith Committed by Harsh Shah

Updated - HT017 - Enable login until email address _and_ password have been entered.

parent eddf3069
...@@ -17,7 +17,40 @@ ...@@ -17,7 +17,40 @@
</head> </head>
<body class="bg-color"> <body class="bg-color">
<script type="text/javascript">
var interval;
$(document).ready(function() {
validate();
$('input').on('change keyup', function() { validate() });
interval = setInterval(function() { validate(); }, 500);
});
function validate() {
var empty = false;
$('input[required]').each(function() {
if ($( this ).val() == '') {
empty = true;
if ($( this ).css('background-color') == 'rgb(250, 255, 189)') {
empty = false;
}
}
});
if (empty) {
$('.login-btn').attr('disabled', 'disabled');
} else {
$('.login-btn').removeAttr('disabled');
clearInterval(interval);
}
}
</script>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
</style>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="main-verify-identity"> <div class="main-verify-identity">
...@@ -28,11 +61,11 @@ ...@@ -28,11 +61,11 @@
<div class="form-group text-left"> <div class="form-group text-left">
<label>Email Address</label> <label>Email Address</label>
<input type="text" class="form-control" name="username"> <input type="text" class="form-control" name="username" required>
</div> </div>
<div class="form-group text-left"> <div class="form-group text-left">
<label>Password</label> <label>Password</label>
<input type="password" class="form-control" name="password"> <input type="password" class="form-control" name="password" required>
</div> </div>
<div class="form-group"> <div class="form-group">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment