search for: fieldwitherror

Displaying 20 results from an estimated 34 matches for "fieldwitherror".

Did you mean: fieldwitherrors
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 Jul 12
0
Give form elements "fieldWithErrors" class in non-std. way?
All, I want to know how to force an element of my model to be invalid, but not generate any message for it, so that the corresponding form field on a form will show up with the ''fieldWithErrors'' class. I have some checkboxes on my RHTML form, and they are generated with this code <%= check_box_tag("current_job[target_list_ids][]"...etc. %> target_list_ids is an attr_accessor attribute and does not exist in the backing table for my model. If none of these ch...
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. Does anyone know of a fix for this? I tried using border-color instead of background-color in the css element but it didn'...
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 { margin:0; padding: 0; display: inline; } to no avail. Yes I am selecting the...
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 removed if there''re no more errors. How it can be (easily) done? -- Posted via http://www.ruby-forum.com/.
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| %>...
2006 Aug 31
1
Peculiar validation error: undefined local variable or method 'fieldWithErrors'
...rm 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> Extracted source (around line #52): 49: 50: <p> 51: <label for="property_profile_postcode">Postcode</label> 52: <%= p.text_field :postcode, {:class => ''inputMedium''} %> 53: </p> 54: </f...
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 02
3
Disabling Error Divs
I am trying to figure out how to disable the error field thing in rails, the thing that wraps errous fields with a div (class fieldWithError). Any help on this would be great! -Ray -- Posted via http://www.ruby-forum.com/.
2006 Oct 04
0
Displaying validates_acceptance_of Errors In A Check Box
...ich is generated by the check_box helper is also highlighted, and the text next to it loses its styling. My code follows. Should I get cleverer with the CSS or write my own check_box helper which wouldn''t wrap both the visible and the hidden check boxes in <div class=''fieldWithError'' /> tags -- or something else altogether? In my customer model I have: validates_acceptance_of :terms In my view I have: <% form_for :customer, @customer, :url => { :action => :store } do | c| %> <p><%= c.check_box :terms %> I have read and agree to...
2006 Apr 22
4
How to supress field name in error message?
Hi How do I supress the reporting of a field name in the full error message? I want the error to be associated with the field so that the .fieldWithErrors class is applied to the field but I don''t want it to add the field name to the actual error message. For example: errors.add("occurs_on", "The date can''t be today!") unless occurs_on != Date.today I would like the error to read: The date can''t...
2005 Dec 26
3
Override Validation?
Hi all, is there a way to override the validation methods so as to avoid the div.fieldWithErrors divs from being created on the redisplayed form? Many thanks in advance, Nicky
2006 May 07
2
label tag with errors?
...;%= label(''object'',''property'',''Property'') %> To generate: <label for="object_property">Property</label> And if there are errors on object.property, generate this: <label for="object_property" class="fieldWithErrors">Property</label> First of all, is there an easy way to do this? I''m assuming there isn''t, so I thought it shouldn''t be too hard to create my own helped to do this, but after taking a look at the source for the other tags (text_field, check_box, etc.), it...
2006 Feb 13
3
Getting Rid of Error Divs around fields that have errors
Is there a way to get rid of the divs around an error field. These divs are causing me headaches. Any suggestions :-)? John Kopanas http://www.kopanas.com ===================================================================== http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference
2006 Apr 09
12
Validating two models from one form
...and I want to build a form. The tricky thing is, this form needs to insert / update against two models, each with their own validation rules. Unfortunately, I''m having an incredible amount of difficulty with the error handling, specifically the fields wrapped in <div class=''fieldWithErrors''></div> nevans@bell:app/models$ ls user_preference.rb user.rb The User class has_one :user_preference, and UserPreference belongs_to :user. Both classes have a half dozen validation rules or so. In my RegisterController, I have two actions: one to display the form, and one...
2006 Jul 20
7
How do you use :message with validation?
If I do validates_uniqueness_of :name, :message => "It''s not uniqueeee!!!" then how do I have it display that message when the check fails? -Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2010 Oct 09
2
Rails 3 upgraded form validation issue
H All, I have run into a very interesting issue. On one of my apps, after upgrading from 2.3 to 3.0, the form validation started to escape html. Normally what should happen when you submit a form and one of the fields fails validation that field would get surrounded with a <div class="fieldWithErrors"> and so on. That seems to be broken in my app and what I get is the correct html but it is escaped, so in the browser I see the actual html code instead of the input control. For instance, this excerpt from the html source: <div class="field"> &lt;span class=&...
2006 Apr 01
0
A missing piece in Prototype helpers
Hi, I wanted to use select helper to provide a parameter for a function call and could not make it work. I wanted to do this: page.call ''Field.activate'', page.select(''#customer_form .edit-form div.fieldWithErrors input'').first and ended up writing pure Javascript: page << ''Field.activate($$("#customer_form .edit-form div.fieldWithErrors input").first());'' If someone can figure out the way to get it to work without << operator, please post. -- Posted...
2010 Dec 14
4
Custom form error messages
...or message of each field in front of the input field? I haven''t been able to find anything similar on google. All I''ve found is how to override the container around the input field. ActionView::Base.field_error_proc = Proc.new { |html_tag, instance| "<span class=\"fieldWithErrors\">#{html_tag}</span>" } Or in here do we have access of the error message of the current field? Greg -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to thi...
2010 Sep 23
7
errors.add, setting the whole message
...ve an attribute, job_role_id_short, that is being set in a form. This field has a custom validation on it, which does this if it fails: self.errors.add(:job_role_id_short, "cannot be blank") I want to add the error onto the attribute, so that the form builder will wrap the field in a fieldWithErrors div. However, the error it generates says "Job Role Short cannot be blank". I''d like it to say "Job cannot be blank". Is there a way of adding an error to a specific attribute that will let me set the whole error message, not just the last part of it? thanks, max -...