captcha reminder

This commit is contained in:
James Campos 2010-08-25 10:31:24 -07:00
parent 2291b490da
commit 3a331f1547
2 changed files with 32 additions and 7 deletions

View File

@ -425,10 +425,21 @@ iframeLoad = ->
remove(qr) remove(qr)
submit = -> submit = (e) ->
this.style.visibility = 'collapse' if span = @nextSibling
if span = this.nextSibling
remove(span) remove(span)
recaptcha = $('#recaptcha_response_field', this)
if not recaptcha.value
e.preventDefault()
span = make 'span', {
className: 'error'
textContent: 'You forgot to type in the verification.'
}
@parentNode.appendChild span
alert 'You forgot to type in the verification.'
recaptcha.focus()
else
@style.visibility = 'collapse'
minimize = -> minimize = ->

View File

@ -462,10 +462,24 @@
return remove(qr); return remove(qr);
} }
}; };
submit = function() { submit = function(e) {
var span; var recaptcha, span;
this.style.visibility = 'collapse'; if (span = this.nextSibling) {
return (span = this.nextSibling) ? remove(span) : null; remove(span);
}
recaptcha = $('#recaptcha_response_field', this);
if (!recaptcha.value) {
e.preventDefault();
span = make('span', {
className: 'error',
textContent: 'You forgot to type in the verification.'
});
this.parentNode.appendChild(span);
alert('You forgot to type in the verification.');
return recaptcha.focus();
} else {
return (this.style.visibility = 'collapse');
}
}; };
minimize = function() { minimize = function() {
var form; var form;