removing some validation
This commit is contained in:
		
							parent
							
								
									18ac5d8959
								
							
						
					
					
						commit
						ccb8f2537c
					
				| @ -73,7 +73,7 @@ | |||||||
|         <!-- <button class="dap-full-button-green js-remember-btn js-authz-remember-me">SIGN IN ONCE</button> --> |         <!-- <button class="dap-full-button-green js-remember-btn js-authz-remember-me">SIGN IN ONCE</button> --> | ||||||
|         <button type="button" class="btn btn-primary">Send Code Again</button> |         <button type="button" class="btn btn-primary">Send Code Again</button> | ||||||
|         <button type="button" class="btn btn-primary">Edit My Email</button> |         <button type="button" class="btn btn-primary">Edit My Email</button> | ||||||
|         <button type="button" class="btn btn-primary submit-btn dap-full-button-green js-remember-btn js-authz-remember-me" disabled>Submit</button> |         <button type="button" class="btn btn-primary submit-btn dap-full-button-green js-remember-btn js-authz-remember-me">Submit</button> | ||||||
|       </form> |       </form> | ||||||
|       <!-- <a href="./authnocode.html" target="_blank"> |       <!-- <a href="./authnocode.html" target="_blank"> | ||||||
|         <p class="dap-centered-text dap-help-text">I didn't receive my code...</p> |         <p class="dap-centered-text dap-help-text">I didn't receive my code...</p> | ||||||
|  | |||||||
							
								
								
									
										48
									
								
								js/script.js
									
									
									
									
									
								
							
							
						
						
									
										48
									
								
								js/script.js
									
									
									
									
									
								
							| @ -34,6 +34,7 @@ | |||||||
| //   }
 | //   }
 | ||||||
| // });
 | // });
 | ||||||
| $('body').on('click', '.js-remember-label', function (ev) { | $('body').on('click', '.js-remember-label', function (ev) { | ||||||
|  |   'use strict'; | ||||||
|   ev.preventDefault(); |   ev.preventDefault(); | ||||||
|   ev.stopPropagation(); |   ev.stopPropagation(); | ||||||
|   var $this = $(this); |   var $this = $(this); | ||||||
| @ -45,6 +46,7 @@ $('body').on('click', '.js-remember-label', function (ev) { | |||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| $('body').on('click', '.check', function () { | $('body').on('click', '.check', function () { | ||||||
|  |   'use strict'; | ||||||
|   var $img = $(this); |   var $img = $(this); | ||||||
|   if($img.attr("src") === "./img/pressed-check.png") { |   if($img.attr("src") === "./img/pressed-check.png") { | ||||||
|     $img.attr("src", "./img/unpressed-check.png"); |     $img.attr("src", "./img/unpressed-check.png"); | ||||||
| @ -56,6 +58,7 @@ $('body').on('click', '.check', function () { | |||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| $('body').on('click', '.js-auth-li-enabled', function (ev) { | $('body').on('click', '.js-auth-li-enabled', function (ev) { | ||||||
|  |   'use strict'; | ||||||
|   ev.preventDefault(); |   ev.preventDefault(); | ||||||
|   ev.stopPropagation(); |   ev.stopPropagation(); | ||||||
|   var $this = $(this); |   var $this = $(this); | ||||||
| @ -66,29 +69,31 @@ $('body').on('click', '.js-auth-li-enabled', function (ev) { | |||||||
|   } |   } | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| $('body').on('keyup keypress', '.js-authn-otp-code', function (e) { | // $('body').on('keyup keypress', '.js-authn-otp-code', function (e) {
 | ||||||
|   var keyCode = e.keyCode || e.which; | //   'use strict';
 | ||||||
|   var regex = new RegExp('^[0-9 \-]+$'); | //   var keyCode = e.keyCode || e.which;
 | ||||||
|   var key = String.fromCharCode(!e.charCode ? e.which : e.charCode); | //   var regex = new RegExp('^[0-9 \-]+$');
 | ||||||
|   var oauthCode = $(this).val().split('-').join('').replace(/\s/g, ''); | //   var key = String.fromCharCode(!e.charCode ? e.which : e.charCode);
 | ||||||
| 
 | //   var oauthCode = $(this).val().split('-').join('').replace(/\s/g, '');
 | ||||||
|   if (!regex.test(key)) { | //
 | ||||||
|      event.preventDefault(); | //   if (!regex.test(key)) {
 | ||||||
|      return false; | //      event.preventDefault();
 | ||||||
|   } | //      return false;
 | ||||||
| 
 | //   }
 | ||||||
|   if (oauthCode.length > 0) { | //
 | ||||||
|     oauthCode = oauthCode.match(new RegExp('.{1,4}', 'g')).join("-"); | //   if (oauthCode.length > 0) {
 | ||||||
|   } | //     oauthCode = oauthCode.match(new RegExp('.{1,4}', 'g')).join("-");
 | ||||||
| 
 | //   }
 | ||||||
|   $(this).val(oauthCode); | //
 | ||||||
| 
 | //   $(this).val(oauthCode);
 | ||||||
|   if($(this).val().length == $(this).attr("maxlength")){ | //
 | ||||||
|     $('.submit-btn').prop("disabled", false); | //   if($(this).val().length === $(this).attr("maxlength")){
 | ||||||
|   } | //     $('.submit-btn').prop("disabled", false);
 | ||||||
| }); | //   }
 | ||||||
|  | // });
 | ||||||
| 
 | 
 | ||||||
| $('body').on('keyup', '.js-oauth3-email', function () { | $('body').on('keyup', '.js-oauth3-email', function () { | ||||||
|  |   'use strict'; | ||||||
|   var emailAddress = $(this).val(); |   var emailAddress = $(this).val(); | ||||||
|   var emailRegex = new RegExp(/^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$/i); |   var emailRegex = new RegExp(/^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$/i); | ||||||
|   var valid = emailRegex.test(emailAddress); |   var valid = emailRegex.test(emailAddress); | ||||||
| @ -102,6 +107,7 @@ $('body').on('keyup', '.js-oauth3-email', function () { | |||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| $('body').on('blur', '.js-oauth3-email', function () { | $('body').on('blur', '.js-oauth3-email', function () { | ||||||
|  |   'use strict'; | ||||||
|   var emailAddress = $(this).val(); |   var emailAddress = $(this).val(); | ||||||
|   $('.email-address').text(emailAddress); |   $('.email-address').text(emailAddress); | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user