Hello All, how do i disable child form elements of any div [ html obj ], so that they will not get posted. Is there any other way, to toggle form elements while form post ??> ~~~<form> <div1> form elements </div>> <div2>form elements </div2> </form> ~~~ Sandip R~ -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If you are using prototype, you can get (for example) all the divs with the $$ function and then disable the form elements, see http://www.prototypejs.org/api/utility/dollar-dollar. Regards. Franco Catena. On Jun 24, 10:51 am, Sandip Ransing <san2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello All, > how do i disable child form elements of any div [ html obj ], so that they > will not get posted. > Is there any other way, to toggle form elements while form post ?? > > > ~~~ > > <form> > > <div1> > > form elements > > </div> > > > <div2> > > form elements > > </div2> > > </form> > > ~~~ > > Sandip R~ > > -- > Ruby on Rails Developerhttp://sandip.sosblog.comhttp://funonrails.wordpress.comwww.joshsoftware.com
2009/6/24 Sandip Ransing <san2821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Hello All, > how do i disable child form elements of any div [ html obj ], so that they > will not get posted. > Is there any other way, to toggle form elements while form post ?? >> >> ~~~ >> >> <form> >> >> <div1> >> >> form elements >> >> </div> >> >> <div2> >> >> form elements >> >> </div2> >> >> </form> >>Do you mean disable? If what you are trying to do is to prevent them from being posted when the form is submitted then disabling them is not what you need to do. As far as I know there is no way of preventing fields that have values from being posted though others may correct me on this. Why can you not just ignore the irrelevant fields when the form is submitted? Colin
Thanks, for reply ! following trick worked for me... I created one hidden div outside form tag and while submitting form appended unnecessary div ( with form elements ) to the hidden div outside form tag. JavaScript method> outer_hidden_div.appendChild( unnnecessary_div_inside_form_tag )Sandip R~ On Thu, Jun 25, 2009 at 1:12 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > 2009/6/24 Sandip Ransing <san2821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > Hello All, > > how do i disable child form elements of any div [ html obj ], so that > they > > will not get posted. > > Is there any other way, to toggle form elements while form post ?? > >> > >> ~~~ > >> > >> <form> > >> > >> <div1> > >> > >> form elements > >> > >> </div> > >> > >> <div2> > >> > >> form elements > >> > >> </div2> > >> > >> </form> > >> > > Do you mean disable? If what you are trying to do is to prevent them > from being posted when the form is submitted then disabling them is > not what you need to do. As far as I know there is no way of > preventing fields that have values from being posted though others may > correct me on this. Why can you not just ignore the irrelevant fields > when the form is submitted? > > Colin > > > >-- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Himanshu Prakash
2009-Jun-25 08:58 UTC
Re: How to disable form elements under any div ????
Sandip, you can set the the [html obj]''s style as: html_obj.style.display=""; I hope it will do.. On Wed, Jun 24, 2009 at 7:21 PM, Sandip Ransing <san2821-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello All, > how do i disable child form elements of any div [ html obj ], so that they > will not get posted. > Is there any other way, to toggle form elements while form post ?? > >> ~~~ > > <form> > > <div1> > > form elements > > </div> > > >> <div2> > > form elements > > </div2> > > </form> > > ~~~ > > > > Sandip R~ > > -- > Ruby on Rails Developer > http://sandip.sosblog.com > http://funonrails.wordpress.com > www.joshsoftware.com > > > > >-- Regards, Himanshu --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---