Check if form is filled before send
This commit is contained in:
parent
1c885d9c6d
commit
464b3a47c0
|
@ -46,7 +46,23 @@ block extrahead
|
||||||
}
|
}
|
||||||
|
|
||||||
block content
|
block content
|
||||||
form.form-signin(method="POST", action='/feedback-target')
|
script.
|
||||||
|
function checkForm() {
|
||||||
|
var allAnswered = true;
|
||||||
|
$("input:radio").each(function(){
|
||||||
|
var name = $(this).attr("name");
|
||||||
|
if($("input:radio[name="+name+"]:checked").length == 0)
|
||||||
|
{
|
||||||
|
allAnswered = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!allAnswered) {
|
||||||
|
alert('You did not answer all the questions');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
form.form-signin(method="POST", action='/feedback-target', onsubmit='return checkForm()')
|
||||||
h2 Please give us your feedback
|
h2 Please give us your feedback
|
||||||
|
|
||||||
+rate(1, "What was the difficulty level without recommendation ?")
|
+rate(1, "What was the difficulty level without recommendation ?")
|
||||||
|
|
Loading…
Reference in New Issue