clear captcha on submit
This commit is contained in:
parent
4ce27d6e0a
commit
4e08b75895
@ -426,6 +426,7 @@ iframeLoad = ->
|
||||
qr.appendChild(span)
|
||||
else if REPLY and getConfig('Persistent QR')
|
||||
$('textarea', qr).value = ''
|
||||
$('input[name=recaptcha_response_field]', qr).value = ''
|
||||
else
|
||||
remove qr
|
||||
|
||||
@ -435,8 +436,10 @@ iframeLoad = ->
|
||||
submit = (e) ->
|
||||
if span = @nextSibling
|
||||
remove(span)
|
||||
recaptcha = $('#recaptcha_response_field', this)
|
||||
if not recaptcha.value
|
||||
recaptcha = $('input[name=recaptcha_response_field]', this)
|
||||
if recaptcha.value
|
||||
$('#qr input[title=autohide]:not(:checked)')?.click()
|
||||
else
|
||||
e.preventDefault()
|
||||
span = n 'span', {
|
||||
className: 'error'
|
||||
@ -445,8 +448,6 @@ submit = (e) ->
|
||||
@parentNode.appendChild span
|
||||
alert 'You forgot to type in the verification.'
|
||||
recaptcha.focus()
|
||||
else
|
||||
$('#qr input[title=autohide]:not(:checked)')?.click()
|
||||
|
||||
|
||||
autohide = ->
|
||||
|
||||
@ -466,6 +466,7 @@
|
||||
qr.appendChild(span);
|
||||
} else if (REPLY && getConfig('Persistent QR')) {
|
||||
$('textarea', qr).value = '';
|
||||
$('input[name=recaptcha_response_field]', qr).value = '';
|
||||
} else {
|
||||
remove(qr);
|
||||
}
|
||||
@ -476,8 +477,10 @@
|
||||
if (span = this.nextSibling) {
|
||||
remove(span);
|
||||
}
|
||||
recaptcha = $('#recaptcha_response_field', this);
|
||||
if (!recaptcha.value) {
|
||||
recaptcha = $('input[name=recaptcha_response_field]', this);
|
||||
if (recaptcha.value) {
|
||||
return (typeof (_ref3 = ((_ref2 = $('#qr input[title=autohide]:not(:checked)')))) === "undefined" || _ref3 === null) ? undefined : _ref3.click();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
span = n('span', {
|
||||
className: 'error',
|
||||
@ -486,8 +489,6 @@
|
||||
this.parentNode.appendChild(span);
|
||||
alert('You forgot to type in the verification.');
|
||||
return recaptcha.focus();
|
||||
} else {
|
||||
return (typeof (_ref3 = ((_ref2 = $('#qr input[title=autohide]:not(:checked)')))) === "undefined" || _ref3 === null) ? undefined : _ref3.click();
|
||||
}
|
||||
};
|
||||
autohide = function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user