diff --git a/lib/really_simple_captcha/captcha/plain_captcha.rb b/lib/really_simple_captcha/captcha/plain_captcha.rb index 25a7c52..1efc44f 100644 --- a/lib/really_simple_captcha/captcha/plain_captcha.rb +++ b/lib/really_simple_captcha/captcha/plain_captcha.rb @@ -44,7 +44,7 @@ module ReallySimpleCaptcha::Captcha content_tag :div, class: 'plain_captcha' do html = image_tag "data:image/gif;base64,#{image}", alt: "Captcha" - html.concat text_field_tag PlainCaptcha.field_name, nil, required: 'required', autocomplete: 'off' + html.concat text_field_tag PlainCaptcha.field_name, nil, id: "reverse_captcha_#{Time.now.nsec}", required: 'required', autocomplete: 'off' html end diff --git a/lib/really_simple_captcha/captcha/reverse_captcha.rb b/lib/really_simple_captcha/captcha/reverse_captcha.rb index bd354fd..b3945c8 100644 --- a/lib/really_simple_captcha/captcha/reverse_captcha.rb +++ b/lib/really_simple_captcha/captcha/reverse_captcha.rb @@ -11,7 +11,7 @@ module ReallySimpleCaptcha::Captcha module ViewHelpers def reverse_captcha_tag - content_tag :div, text_field_tag(ReverseCaptcha.field_name), class: 'reverse_captcha', style: 'display: none' + content_tag :div, text_field_tag(ReverseCaptcha.field_name, nil, id: "reverse_captcha_#{Time.now.nsec}"), class: 'reverse_captcha', style: 'display: none' end end