William K. Hatch Jr.
2010-May-25 00:56 UTC
Controlling or disabling cols, size etc. for text fields and text areas?
Hi, I''m new to rails and have hit a minor snag that google isn''t helping with. Basically, I can''t get text fields or text areas to not include size and cols attributes in the tags generated when using a form_for .... f.text_field ... etc within my view. This results in my applied styles being over ridden by the attribute values and, that kinda sucks. Of course I can set the attributes, but that seems ridiculous. How can I prevent these attributes from being generated so that the css can do it''s rightful job? Thanks. Bill -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
hassan.schroeder
2010-May-25 13:23 UTC
Re: Controlling or disabling cols, size etc. for text fields and text areas?
On Mon, May 24, 2010 at 5:56 PM, William K. Hatch Jr. <stompinwilly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Basically, I can''t get text fields or text areas to not include size and cols attributes in the tags generated when using a form_for .... f.text_field ... etc within my view. This results in my applied styles being over ridden by the attribute values and, that kinda sucks. Of course I can set the attributes, but that seems ridiculous. How can I prevent these attributes from being generated so that the css can do it''s rightful job?You can''t, and shouldn''t -- they''re required; see <http://www.w3.org/TR/html401/interact/forms.html#edef-TEXTAREA> That said, I''ve never had a problem applying CSS to tweak a textarea with those attributes, so perhaps you have a different issue? HTH, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
William K. Hatch Jr.
2010-May-25 17:10 UTC
Re: Controlling or disabling cols, size etc. for text fields and text areas?
On May 25, 2010, at 9:23 AM, hassan.schroeder wrote:> On Mon, May 24, 2010 at 5:56 PM, William K. Hatch Jr. > <stompinwilly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Basically, I can''t get text fields or text areas to not include size and cols attributes in the tags generated when using a form_for .... f.text_field ... etc within my view. This results in my applied styles being over ridden by the attribute values and, that kinda sucks. Of course I can set the attributes, but that seems ridiculous. How can I prevent these attributes from being generated so that the css can do it''s rightful job? > > You can''t, and shouldn''t -- they''re required; see > <http://www.w3.org/TR/html401/interact/forms.html#edef-TEXTAREA>yes, although leaving them off doesn''t appear to cause problems. I think making them required is at odds with separating presentation over structure, however.> > That said, I''ve never had a problem applying CSS to tweak a textarea > with those attributes, so perhaps you have a different issue?And you would again be correct...;-( After posting, I experimented some more and discovered the error; I had wrongly concluded that the attributes were over riding the styles. Thanks. Thanks.> > HTH, > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassan > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-May-26 21:34 UTC
Re: Controlling or disabling cols, size etc. for text fields
hassan.schroeder wrote:> On Mon, May 24, 2010 at 5:56 PM, William K. Hatch Jr. > <stompinwilly-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Basically, I can''t get text fields or text areas to not include size and cols attributes in the tags generated when using a form_for .... f.text_field ... etc within my view. This results in my applied styles being over ridden by the attribute values and, that kinda sucks. Of course I can set the attributes, but that seems ridiculous. �How can I prevent these attributes from being generated so that the css can do it''s rightful job? > > You can''t, and shouldn''t -- they''re required; see > <http://www.w3.org/TR/html401/interact/forms.html#edef-TEXTAREA>They are required in HTML 4.01. They, however, appear to be optional in HTML5. Still should be there for now, but hopefully some future version of Rails will drop them as a requirement. Waiting for Microsoft to create a decent browser yet again. -- 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 this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.