Hi there, maybe will sound you naif but I''ve surprisingly found today that someElement.disable() can''t be used for elements that are not inside a form. It seems that one can disable and enable form elements but what about doing that on elements that are not in a form? One possible case occurs when you have elements that do commands, buttons for instance (not form OS buttons but web application''s ones) that should be disabled when some other element''s state forbids that button''s command. Right now I see two alternatives: A) You make all your application inside a big form (which is guaranteed that will lead to nesting forms problems) B) you implement a way to set the disabled state in any element (different image, not to trigger it''s command, etc) Anybody knows another unconfusive and unhakish way to do such a thing? thanks, Sebastian --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sebastian Sastre wrote:> Hi there, > > maybe will sound you naif but I''ve surprisingly found today that > someElement.disable() can''t be used for elements that are not inside a > form.I don''t think it''s valid HTML to have form input elements (input, button, select, etc) outside of a <form> tag. Different browsers handle different invalid DOM''s differently, so I''m not sure you''ll have much luck trying to do this. I usually use a dummy form for these kinds of things (not wrapping the whole doc in a form, cause nested forms aren''t allowed either). Just use small dummy forms for groups of controls: <form name="ignoreme"> <input type="button"....> </form> -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Dear Michael, now I''m reading your reply, I remember I''ve also used a form wrapping something in the past. But was just a workarround and I wasn''t aware of using this sistematically. Also wasn''t pretending to define a more general solution like now. If HTML is limited to not to have controls like those outside forms then the wrapping solution should be atomically and industrially used. By atomic I mean the minimal expression of a control. Now in practice this means to me that I should refactor a wrapper generator of every kind of control that demands a form to exist so it can expectorate healty html. And I understand that this should be made at "atom- level", I mean a little form wraping one control because the (forcibly) injected requeriment to limit the composibility of the controls (to evade the unsuported form nesting). I wonder when will come the day on which HTML becomes what it should for the good of us all? Thanks for your pragmatic reply, cheers ! Sebastian On 2 jul, 14:17, "Michael Peters" <mpet...-aUYv5hkjw45l57MIdRCFDg@public.gmane.org> wrote:> Sebastian Sastre wrote: > > Hi there, > > > maybe will sound you naif but I''ve surprisingly found today that > > someElement.disable() can''t be used for elements that are not inside a > > form. > > I don''t think it''s valid HTML to have form input elements (input, button, > select, etc) outside of a <form> tag. Different browsers handle different > invalid DOM''s differently, so I''m not sure you''ll have much luck trying to > do this. > > I usually use a dummy form for these kinds of things (not wrapping the > whole doc in a form, cause nested forms aren''t allowed either). Just use > small dummy forms for groups of controls: > > <form name="ignoreme"> > <input type="button"....> > </form> > > -- > Michael Peters > Developer > Plus Three, LP--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Michael, it''s me again. I wanted to tell that I''ve also found that some elements in the page are composed forming some kind of control behind the standard ones. Like a button that uses a piece of displayed text (not inputText) and a displayed image (img). A user click on that (non submit) button is also is a kind of input (not escentially diferent by the way). If I manage the javascript object of that button element to disable/enable properly I will have the general solution. Off course every kind of element (this buttons, items on a table, menu items, etc) should know what to do as concrete disable/enable actions and I should specialize the javascript objects to do proper things. But I have no problem doing that. For instance disabling a displayed image will be showing it in kind of gray color (another image load presumably). I know I missing the OS feature of disabling things an it''s desirable performance but I''m willing to evade the form mess that emerges from html''s limitations and at the same time win simplicity without relinquishing to powerful features. Cheers, Sebastian On 2 jul, 14:17, "Michael Peters" <mpet...-aUYv5hkjw45l57MIdRCFDg@public.gmane.org> wrote:> Sebastian Sastre wrote: > > Hi there, > > > maybe will sound you naif but I''ve surprisingly found today that > > someElement.disable() can''t be used for elements that are not inside a > > form. > > I don''t think it''s valid HTML to have form input elements (input, button, > select, etc) outside of a <form> tag. Different browsers handle different > invalid DOM''s differently, so I''m not sure you''ll have much luck trying to > do this. > > I usually use a dummy form for these kinds of things (not wrapping the > whole doc in a form, cause nested forms aren''t allowed either). Just use > small dummy forms for groups of controls: > > <form name="ignoreme"> > <input type="button"....> > </form> > > -- > Michael Peters > Developer > Plus Three, LP--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---