diff --git a/public/javascripts/educoder/edu_account.js b/public/javascripts/educoder/edu_account.js index 89086802..eedc4db5 100644 --- a/public/javascripts/educoder/edu_account.js +++ b/public/javascripts/educoder/edu_account.js @@ -1521,22 +1521,24 @@ function my_account_form_submit() { } } + if ($("input[name='new_password']").length>0){ + if($("input[name='new_password']").val().length<8){ + $("#new_password").focus(); + $("#new_password_hint").show(); + return; + } else { + $("#new_password_hint").hide(); + } - if($("input[name='new_password']").val().length<8){ - $("#new_password").focus(); - $("#new_password_hint").show(); - return; - } else { - $("#new_password_hint").hide(); + if($("input[name='new_password']").val() !== $("input[name='new_password_confirmation']").val() ){ + $("#new_password_confirmation").focus(); + $("#new_password_confirmation_hint").show(); + return; + } else { + $("#new_password_confirmation_hint").hide(); + } } - if($("input[name='new_password']").val() !== $("input[name='new_password_confirmation']").val() ){ - $("#new_password_confirmation").focus(); - $("#new_password_confirmation_hint").show(); - return; - } else { - $("#new_password_confirmation_hint").hide(); - } if ($("#userIdentity").val() == -1) { $("#identity_hint").show();