Hi, I have a form that has two drop down lists in it. I have an observe_field for the first list, that updates the second list. To better visualize this, the first list is country, the second is county. Now all this works fine, the second list is basically a partial and is called correctly and retrieves the correct data when the first list is changed. However, in my edit page, if i save the form only the first list value is saved. The second list value remains the same even if i change the value on the list. Additionally, if i edit the record and only change the second lists'' value it saves the correct data! Is there a problem with observe_field rendering partials in an edit page that messes up the field values? I looked at the generated html and it all looks the same. Any ideas? Thanks in advance, Mike --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Nov-03 16:09 UTC
Re: observe_field - problems saving form values
Mike, I''ve been trying to find an example of how to use this ''double'' dropdown list box for the last months and never found an example. Would you be so kind as to offer up a simple example of how you''re approaching this? I would be most grateful as I have need to do the ''category - subcategory'' entry for a project and have had to make it very awkward to try to accomplish this. Thank you, Kathleen KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org On Nov 2, 11:26 am, MagicLava <magicl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I have a form that has two drop down lists in it. I have an > observe_field for the first list, that updates the second list. > > To better visualize this, the first list is country, the second is > county. > > Now all this works fine, the second list is basically a partial and is > called correctly and retrieves the correct data when the first list is > changed. > > However, in my edit page, if i save the form only the first list value > is saved. The second list value remains the same even if i change the > value on the list. > > Additionally, if i edit the record and only change the second lists'' > value it saves the correct data! > > Is there a problem with observe_field rendering partials in an edit > page that messes up the field values? I looked at the generated html > and it all looks the same. Any ideas? > > Thanks in advance, > > Mike--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''ll post a working example as soon as i can, but i''m still having problems saving the correct data. I''m using a partial for the second drop down, so when the first drop down is changed the observe_field kicks in and renders the partial with the new list. On Nov 3, 4:09 pm, "KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Mike, > I''ve been trying to find an example of how to use this ''double'' > dropdown list box for the last months and never found an example. > Would you be so kind as to offer up a simple example of how you''re > approaching this? I would be most grateful as I have need to do the > ''category - subcategory'' entry for a project and have had to make it > very awkward to try to accomplish this. > Thank you, > Kathleen > KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > On Nov 2, 11:26 am, MagicLava <magicl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, I have a form that has two drop down lists in it. I have an > > observe_field for the first list, that updates the second list. > > > To better visualize this, the first list is country, the second is > > county. > > > Now all this works fine, the second list is basically a partial and is > > called correctly and retrieves the correct data when the first list is > > changed. > > > However, in my edit page, if i save the form only the first list value > > is saved. The second list value remains the same even if i change the > > value on the list. > > > Additionally, if i edit the record and only change the second lists'' > > value it saves the correct data! > > > Is there a problem with observe_field rendering partials in an edit > > page that messes up the field values? I looked at the generated html > > and it all looks the same. Any ideas? > > > Thanks in advance, > > > Mike--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
6edeon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Nov-05 10:59 UTC
Re: observe_field - problems saving form values
Hmm how about this example? http://mudabone.com/aietc/?page_id=410 I tried this with 2 drop down lists, the first one containing a list of publications and the second one containing a list of available issues for the selected publication. Worked without any problem :) On Nov 5, 5:18 pm, MagicLava <magicl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ll post a working example as soon as i can, but i''m still having > problems saving the correct data. > > I''m using a partial for the second drop down, so when the first drop > down is changed the observe_field kicks in and renders the partial > with the new list. > > On Nov 3, 4:09 pm, "KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > Mike, > > I''ve been trying to find an example of how to use this ''double'' > > dropdown list box for the last months and never found an example. > > Would you be so kind as to offer up a simple example of how you''re > > approaching this? I would be most grateful as I have need to do the > > ''category - subcategory'' entry for a project and have had to make it > > very awkward to try to accomplish this. > > Thank you, > > Kathleen > > KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > On Nov 2, 11:26 am, MagicLava <magicl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, I have a form that has two drop down lists in it. I have an > > > observe_field for the first list, that updates the second list. > > > > To better visualize this, the first list is country, the second is > > > county. > > > > Now all this works fine, the second list is basically a partial and is > > > called correctly and retrieves the correct data when the first list is > > > changed. > > > > However, in my edit page, if i save the form only the first list value > > > is saved. The second list value remains the same even if i change the > > > value on the list. > > > > Additionally, if i edit the record and only change the second lists'' > > > value it saves the correct data! > > > > Is there a problem with observe_field rendering partials in an edit > > > page that messes up the field values? I looked at the generated html > > > and it all looks the same. Any ideas? > > > > Thanks in advance, > > > > Mike--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for the link, i''ll try this later. A small update from me; my original code works in ie6 and ie7! but my development browser Firefox fails!!! I''ll look into this more and report back once i have an answer. On Nov 5, 10:59 am, "6ed...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <6ed...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hmm how about this example? > > http://mudabone.com/aietc/?page_id=410 > > I tried this with 2 drop down lists, the first one containing a list > of publications and the second one containing a list of available > issues for the selected publication. Worked without any problem :) > > On Nov 5, 5:18 pm,MagicLava<magicl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''ll post a working example as soon as i can, but i''m still having > > problems saving the correct data. > > > I''m using a partial for the second drop down, so when the first drop > > down is changed the observe_field kicks in and renders the partial > > with the new list. > > > On Nov 3, 4:09 pm, "KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > Mike, > > > I''ve been trying to find an example of how to use this ''double'' > > > dropdown list box for the last months and never found an example. > > > Would you be so kind as to offer up a simple example of how you''re > > > approaching this? I would be most grateful as I have need to do the > > > ''category - subcategory'' entry for a project and have had to make it > > > very awkward to try to accomplish this. > > > Thank you, > > > Kathleen > > > KathysK...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > > On Nov 2, 11:26 am,MagicLava<magicl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, I have a form that has two drop down lists in it. I have an > > > > observe_field for the first list, that updates the second list. > > > > > To better visualize this, the first list is country, the second is > > > > county. > > > > > Now all this works fine, the second list is basically a partial and is > > > > called correctly and retrieves the correct data when the first list is > > > > changed. > > > > > However, in my edit page, if i save the form only the first list value > > > > is saved. The second list value remains the same even if i change the > > > > value on the list. > > > > > Additionally, if i edit the record and only change the second lists'' > > > > value it saves the correct data! > > > > > Is there a problem with observe_field rendering partials in an edit > > > > page that messes up the field values? I looked at the generated html > > > > and it all looks the same. Any ideas? > > > > > Thanks in advance, > > > > > Mike--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---