similar to: Give form elements "fieldWithErrors" class in non-std. way?

Displaying 20 results from an estimated 3000 matches similar to: "Give form elements "fieldWithErrors" class in non-std. way?"

2006 Jul 11
4
checkboxes with a has_many :through relation
All, I''m populating a view with checkboxes in a list. I want to be able to assign to my has_many relationship using the post values of these checkboxes. Essentially, I want to populate the relationship table which will create the correct join values in my model. Here is my check_box_tag code: <%= check_box_tag("@current_job[target_list_ids][]",
2007 Nov 27
1
O/T div.fieldWithErrors styling
this is kinda trivial but I''m anal and it bugs me :) whenever there''s a error in the form the error field is wrapped with <div class="fieldWithErrors"> </div> this throws my form''s styling off because it puts too much space b/t fields and worse makes the form as wide as possible. How do I fix this? I''ve tried div.fieldWithErrors {
2005 Aug 19
1
css style fieldWithErrors when using tables
I''ve run across something that I''m not sure how to fix. This is with MSIE, Firefox doesn''t seem to have the same problem. When rails displays form fields in error using the css element fieldWithErrors, and the form field is enclosed in a table data tag, the entire background of the table data element is set to red instead of just the border of the form element.
2007 Jan 13
1
fieldWithErrors - does not work
What conditions must be met for ''fieldWithErrors'' automatic wrapping? <% remote_form_for( :subscriber, :update => ''subscription'', :url => {:controller => ''subscribers'', :action => ''subscribe''} ) do |form| %> <p> <%= form.text_field
2006 Feb 21
1
Custom forms and fieldWithErrors tags
Hi, (probably) A newbie questions: I have a form where a user can choose an email address, but there are only some choices for the domain, so I wrote a helper where the local part of the email is a text field and the domains is a dropdown list, like: Select Email: [ my_name ] @ <domain.com> ..which I defined as a helper: def email_form(tagname, domain_list)
2006 Aug 31
1
Peculiar validation error: undefined local variable or method 'fieldWithErrors'
Hello all, I''m submitting a form with the following field - <%= p.text_field :postcode, {:class => ''inputMedium''} %> and on submitting the form I am getting this error - NameError in Property#create Showing app/views/property/sell.rhtml where line #52 raised: undefined local variable or method `fieldWithErrors'' for #<Object: 0x1de968>
2006 Mar 25
7
Overriding <div class="fieldWithErrors">
Does anyone know how to override the <div class="fieldWithErrors"> behaviour when a form field is incorrect? Thanks, Dan
2006 Feb 24
5
Changing default behavior of fieldWithErrors
Hi! The topic can be a bit misleading, because it may suggest that i want to change css style. What i''d like to change is that normally, when there''s an error, rails creates a div element with the fieldWithErrors class as the parent of the input. I''d like to change this behavior, so the input element itself will have this class added to its current classes and
2013 May 27
3
Ransack, acts-as-taggable-on and checkboxes in search form
need some help on ransack filtering. I have model Project, which has many tags through acts_as_taggable gem. Project.rb: class Project < ActiveRecord::Base include PublicActivity::Common belongs_to :customer belongs_to :category has_many :attachments, :as => :attachable has_many :reports, :dependent => :destroy has_many :messages, :dependent
2011 May 30
5
rails habtm checkboxes with jquerymobile
Hi guys, I have a habtm association working properly. My application consists of both a desktop and a mobile version. My mobile version is made with jquerymobile and I would like my checkboxes in the edit form to look like the checkboxes shown in http://jquerymobile.com/demos/1.0a4.1/#docs/forms/forms-checkboxes.html. My desktop code is the following: <%= check_box_tag
2008 Mar 02
2
check_box_tag remote_function
I have a collection of check_box_tags that look like the following: <% for item in @items %> <%= check_box_tag "item[item_ids][]", item.id, false, {:onchange => remote_function(:url => update_items_path, :with => "''items='' + escape(value) "} %> <%= item.name %> <% end %> My question is, how do I send all of the current
2006 Jul 18
2
validate method doesn''t recognize another instance method
All, I am attempting to do some custom validation on my object. Here is my validate method: protected def validate puts "Do I have the target_list_ids method? " + self.methods.include?(''target_list_ids'').to_s if target_list_ids.nil? || target_list_ids.length == 0 errors.add_to_base("You must choose at least one target list for this job")
2008 Jan 31
3
Handling multiple Check boxes in a XHTML Strict way
Hi, The default way we handle an array of checkboxes is like this: <% items.each do |item| %> <%= check_box_tag ''item[]'', "#{item.id}" %> <% end -%> this returns an array item[] that holds the ids of all the items. Now the real issue: 1. The above loop will same ids to ''n'' items 2. All ids will be ''item[]''
2006 Aug 07
2
Getting an array of ids from form checkboxes?
Is it possible to set up a list of checkboxes so that the form parameters are given in an array (eg {"delete_list" => [3,6,7]}) ? At the moment I''m using <%= check_box_tag "delete_list[#{post.id}]" %> ...which gives parameters looking like {"delete_list" => {"3" => "1", "6" => "1",
2005 Dec 21
3
Checkbox readonly
I declare some checkboxes : <%= check_box_tag ''offers[]'', offer.id , @params[:offers].include?(offer.id.to_s) ,:readonly=>true %> the result is : <input checked="checked" id="offers[]" name="offers[]" readonly="readonly" type="checkbox" value="1" /> But readonly doesn''t work ??? -- Posted
2006 Apr 27
2
check_box_tag and :disabled => ''disabled'' problem
I''ve been using the check_box_tag to generate checkboxes for an application I am working on and I''ve run into a little hiccup. When I set the options for the checkbox to be { :disabled => "disabled" } the checkbox becomes disabled, as I would expect. However, if I set the checked value to true and keep the disabled option, the value for the checkbox is not returned.
2006 Dec 27
0
HABTM Checkboxes - Adding/Updating Users to a Project
Hello all, I''m trying to create a HABTM checkbox action that adds/updates ''users'' to a ''project''. I have the following laid out. --------------------- TABLES --------------------- create_table "assignments", :id => false, :force => true do |t| t.column "project_id", :integer, :default => 0, :null => false
2006 Apr 04
6
check_box_tag is limited?
Hello all. Am I going totally nuts here and just want to check (Natch!) something. A normal check_box has two value posssibilities. One for checked and one for unchecked, the value gets submitted with a form. The check_box_tag on the other hand, has a checked_value (Called just ''value'') and for the unchecked value...nothing, zip, nada. This means that if you submit a form with
2006 Jul 04
1
Has_many :through with checkboxes?
Just when I started getting the hang of has_and_belongs_to_many relationships, I realize that I should probably convert several of my app''s joins to has_many :through type relationships. One example, pairing users with categories via subscriptions, where each user can be the "owner" of a category, has given me particular trouble when I try to update a user''s
2008 Jan 18
0
Update All using Checkboxes
So I have a list of jobs which I show like this. (cleaned up..) _list.rhtml <table> <% for job in @jobs %> <tr><td><%= job.name %></td></tr> <% end %> I want checkboxes next to each and every job name and a button or link somewhere else on the page to "delete selected", "publish selected" , and "unpublish selected"