I''m curious: why aren''t <button> elements extended with the form helper functions like other form elements, like <input> or <select>. It''d be really nice to be able to do button.disable() and .enable(), for instance. It''s a simple one line, copy-and-paste fix in the Prototype code, so I figure I must be missing something obvious. What''s the problem with extending <button>s? :Dan Dorman --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
i believe $(''button_id'').disabled = true | false works. On 8/21/07, Dan Dorman <dan.dorman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I''m curious: why aren''t <button> elements extended with the form > helper functions like other form elements, like <input> or <select>. > It''d be really nice to be able to do button.disable() and .enable(), > for instance. > > It''s a simple one line, copy-and-paste fix in the Prototype code, so I > figure I must be missing something obvious. What''s the problem with > extending <button>s? > > :Dan Dorman > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 8/21/07, Brian Williams <brianw1975-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i believe $(''button_id'').disabled = true | false works.That''s good to know, but what if I want to do something like $$(''bunch-of-buttons'').invoke(''disable'')? Or if I have a form which has a bunch of <button>s--if I call Form.disable(), the <button>s aren''t disabled. So what gives? :Dan Dorman --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
A <button> tag isn''t a form tag like <input> is. So Form methods shouldn''t be expected to work them. A <button> can be used outside of the context of the form in regular usage. On 8/21/07, Dan Dorman <dan.dorman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 8/21/07, Brian Williams <brianw1975-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > i believe $(''button_id'').disabled = true | false works. > > That''s good to know, but what if I want to do something like > $$(''bunch-of-buttons'').invoke(''disable'')? Or if I have a form which > has a bunch of <button>s--if I call Form.disable(), the <button>s > aren''t disabled. So what gives? > > :Dan Dorman > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
that i cannot answer, i just started using prototype this week. On 8/21/07, Dan Dorman <dan.dorman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 8/21/07, Brian Williams <brianw1975-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > i believe $(''button_id'').disabled = true | false works. > > That''s good to know, but what if I want to do something like > $$(''bunch-of-buttons'').invoke(''disable'')? Or if I have a form which > has a bunch of <button>s--if I call Form.disable(), the <button>s > aren''t disabled. So what gives? > > :Dan Dorman > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 8/21/07, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> A <button> tag isn''t a form tag like <input> is. So Form methods > shouldn''t be expected to work them. A <button> can be used outside of > the context of the form in regular usage.I figured something like that might be the case too, but both the HTML 4 [1] and 5 [2] specs consider <button> to be a form element. XHTML doesn''t seem to break with HTML in this respect. Web Forms 2 also refers to <button> as a form element [3]. 1. http://www.w3.org/TR/1999/PR-html40-19990824/interact/forms.html 2. http://www.whatwg.org/specs/web-apps/current-work/#forms 3. http://www.whatwg.org/specs/web-forms/current-work/#extend-form-controls :Dan Dorman --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Aug 22, 11:47 am, "Andrew Kaspick" <akasp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> A <button> tag isn''t a form tag like <input> is.I think you mean form control. Both button and input elements can be form controls, or not. They can both be used inside or outside a form.> So Form methods > shouldn''t be expected to work them.Because neither implement the HTMLFormElement interface. :-) <URL: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-40002357 >> A <button> can be used outside of > the context of the form in regular usage.As can an input element. HTMLButtonElement: <URL: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-34812697 > HTMLInputElement <URL: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025 > -- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hmm, ok, thanks for correcting me then. Seems odd though that my xhtml validator has no problem with a <button> tag outside of a form, but complains about a <input> tag outside of a form. On 8/21/07, Dan Dorman <dan.dorman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 8/21/07, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > A <button> tag isn''t a form tag like <input> is. So Form methods > > shouldn''t be expected to work them. A <button> can be used outside of > > the context of the form in regular usage. > > I figured something like that might be the case too, but both the HTML > 4 [1] and 5 [2] specs consider <button> to be a form element. XHTML > doesn''t seem to break with HTML in this respect. Web Forms 2 also > refers to <button> as a form element [3]. > > 1. http://www.w3.org/TR/1999/PR-html40-19990824/interact/forms.html > 2. http://www.whatwg.org/specs/web-apps/current-work/#forms > 3. http://www.whatwg.org/specs/web-forms/current-work/#extend-form-controls > > :Dan Dorman > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
xhtml 1.0 strict that is On 8/21/07, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hmm, ok, thanks for correcting me then. > > Seems odd though that my xhtml validator has no problem with a > <button> tag outside of a form, but complains about a <input> tag > outside of a form. > > On 8/21/07, Dan Dorman <dan.dorman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 8/21/07, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > A <button> tag isn''t a form tag like <input> is. So Form methods > > > shouldn''t be expected to work them. A <button> can be used outside of > > > the context of the form in regular usage. > > > > I figured something like that might be the case too, but both the HTML > > 4 [1] and 5 [2] specs consider <button> to be a form element. XHTML > > doesn''t seem to break with HTML in this respect. Web Forms 2 also > > refers to <button> as a form element [3]. > > > > 1. http://www.w3.org/TR/1999/PR-html40-19990824/interact/forms.html > > 2. http://www.whatwg.org/specs/web-apps/current-work/#forms > > 3. http://www.whatwg.org/specs/web-forms/current-work/#extend-form-controls > > > > :Dan Dorman > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve ran across that too because i used Buttons with Images inside the form, and that only works with "button" not with "input[type=button]". Has someone searched dev.rubyonrails.org if a complaint existists already or submitted a bug report yet ? ~ Jan On Aug 22, 3:39 am, "Dan Dorman" <dan.dor...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 8/21/07, Brian Williams <brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > i believe $(''button_id'').disabled = true | false works. > > That''s good to know, but what if I want to do something like > $$(''bunch-of-buttons'').invoke(''disable'')? Or if I have a form which > has a bunch of <button>s--if I call Form.disable(), the <button>s > aren''t disabled. So what gives? > > :Dan Dorman--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Aug 22, 1:33 pm, "Andrew Kaspick" <akasp...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hmm, ok, thanks for correcting me then. > > Seems odd though that my xhtml validator has no problem with a > <button> tag outside of a form, but complains about a <input> tag > outside of a form.Then either your validator is broken, or your code is. Without seeing the code or knowing which validator you are using, it''s impossible to say which. The following validates with the W3C HTML validator: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Title</title> </head> <body> <div><input type="text" /></div> </body> </html> -- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---