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)
submit = ->
this.style.visibility = 'collapse'
if span = this.nextSibling
submit = (e) ->
if span = @nextSibling
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 = ->

View File

@ -462,10 +462,24 @@
return remove(qr);
}
};
submit = function() {
var span;
this.style.visibility = 'collapse';
return (span = this.nextSibling) ? remove(span) : null;
submit = function(e) {
var recaptcha, span;
if (span = this.nextSibling) {
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() {
var form;