Permalink
Browse files

Added negative_label_tag and some XHTML Strict validations.

  • Loading branch information...
1 parent 86cb81d commit 1a66ccb4659ff9f0ff8154b761e0415df7f20a27 @uu uu committed Aug 29, 2009
Showing with 9 additions and 4 deletions.
  1. +9 −4 lib/negative_captcha_view_helpers.rb
@@ -8,17 +8,22 @@ def negative_captcha(captcha)
def negative_text_field_tag(negative_captcha, field, options={})
[
- text_field_tag(negative_captcha.fields[field], negative_captcha.values[field], options.merge(:tabindex => '1')),
- "<div style='position: absolute; left: -2000px;'>" + text_field_tag(field, '', :tabindex => '999', :autocomplete => 'off') + "</div>"
+ text_field_tag(negative_captcha.fields[field], negative_captcha.values[field], options),
+ "<div style='position: absolute; left: -2000px;'>" + text_field_tag(field, '', :tabindex => '999') + "</div>"
].join
end
def negative_text_area_tag(negative_captcha, field, options={})
[
- text_area_tag(negative_captcha.fields[field], negative_captcha.values[field] || options[:value], options.merge(:tabindex => '1')),
- "<div style='position: absolute; left: -2000px;'>" + text_area_tag(field, '', :tabindex => '999', :autocomplete => 'off') + "</div>"
+ text_area_tag(negative_captcha.fields[field], negative_captcha.values[field] || options[:value], options),
+ "<div style='position: absolute; left: -2000px;'>" + text_area_tag(field, '', :tabindex => '999', :rows => 2, :cols => 1) + "</div>"
].join
end
+ def negative_label_tag(negative_captcha, field, name, options={})
+ [
+ label_tag(negative_captcha.fields[field], name, options)
+ ]
+ end
#TODO: Select, check_box, etc
end

0 comments on commit 1a66ccb

Please sign in to comment.