вот моя форма html
Код: Выделить всё
×
Security questions:
Please answer the following security questions, click 'Submit', and you
will receive an email containing instructions on how to change your password.
What was the last name of your third grade teacher?
What is your maternal grandmother's maiden name, please provide full name?
Cancel
Submit
Код: Выделить всё
for (var i = 0; i < $forgotPassQuest.questionId.length; i++){
var questionId = $forgotPassQuest.questionId[i]['id'];
$('#forgotPass_' + questionId).val(null);
}
$('#forgotPassModal').modal({show:true})
$('.forgotPassSubmit').click(function() {
var questAnswered = true;
for (var i = 0; i < $forgotPassQuest.questionId.length; i++){
var questionId = $forgotPassQuest.questionId[i]['id'];
questionField = $('#forgotPass_' + questionId);
questionFieldVal = questionField.val();
if (questionFieldVal == '' || questionFieldVal == null){
questAnswered = false;
} else {}
}
if (questAnswered == true) {
submitAnswers();
} else {
alert('please complete your security questions.');
}
})
$('#forgotPassModal').on('hidden', function () {
$('#forgotPassModal').remove();
});
Подробнее здесь: https://stackoverflow.com/questions/179 ... -for-reuse
Мобильная версия