167
rated 0 times
[
173]
[
6]
/ answers: 1 / hits: 20112
/ 12 Years ago, thu, july 26, 2012, 12:00:00
In my web application, in the login page, I have a checkbox. After entering the username/password, if the user doesn't tick the checkbox (T&C), he should not be taken to the home page, and an alert error message will be shown.
I have tried the following code. But it is not working. That is, an alert message is shown. But the user is taken to the next page(home page). I tried returning false, but no luck.
Can anyone tell how to fix this?
function doSubmit() {
var checkbox = document.getElementById(terms);
if (!checkbox.checked) {
alert(error message here!);
return;
}
document.getElementById(f).submit();
}
I am calling doSubmit from
<input id=proceed onclick=doSubmit() type=submit value=${fn:escapeXml(submit_label)} />
More From » spring