Hi, I found a problem with dynamic reading from input hidden. To better explain my problem I will describe the process: 1. user clicks a "select employer" link which opens dialog 2. dialog is to select proper employer, which id is send back to rjs via Ajax 3. rjs sets a <input type=''hidden'' id=''employer_id'' name=''employer_id''> with the proper value 4. user clicks other link, which sends the employer_id taken from $F(''employer_id'') So, for the first time the step 4 gives a proper value od employer_id. But if I do the procedure once again (I select different emplyer_id) the step 4 is giving me the same employer value, as at the beginning (in first iteration). Using FireBug I can check, that the input hidden is having good values any time I''m doing the procedure. Only reading from $F(''employer_id'') is still the same (not changed). Any suggestions? Tomasz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 23 Mar, 23:08, "Tomasz Tomczyk" <bomek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I found a problem with dynamic reading from input hidden. > To better explain my problem I will describe the process: > 1. user clicks a "select employer" link which opens dialog > 2. dialog is to select proper employer, which id is send back to rjs > via Ajax > 3. rjs sets a <input type=''hidden'' id=''employer_id'' > name=''employer_id''> with the proper value > 4. user clicks other link, which sends the employer_id taken from > $F(''employer_id'') > > So, for the first time the step 4 gives a proper value od employer_id. > But if I do the procedure once again (I select different emplyer_id) > the step 4 is giving me the same employer value, as at the beginning > (in first iteration). > > Using FireBug I can check, that the input hidden is having good values > any time I''m doing the procedure. Only reading from $F(''employer_id'') > is still the same (not changed). > > Any suggestions? > TomaszNo suggestions at all? Maybe just an assumption from somebody? BR, Tomasz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tomasz Tomczyk wrote:> On 23 Mar, 23:08, "Tomasz Tomczyk" <bomek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hi, >> >> I found a problem with dynamic reading from input hidden. >> To better explain my problem I will describe the process: >> 1. user clicks a "select employer" link which opens dialog >> 2. dialog is to select proper employer, which id is send back to rjs >> via Ajax >> 3. rjs sets a <input type=''hidden'' id=''employer_id'' >> name=''employer_id''> with the proper value >> 4. user clicks other link, which sends the employer_id taken from >> $F(''employer_id'') >> >> So, for the first time the step 4 gives a proper value od employer_id. >> But if I do the procedure once again (I select different emplyer_id) >> the step 4 is giving me the same employer value, as at the beginning >> (in first iteration). >> >> Using FireBug I can check, that the input hidden is having good values >> any time I''m doing the procedure. Only reading from $F(''employer_id'') >> is still the same (not changed). >> >> Any suggestions? >> Tomasz >> > > > No suggestions at all? > Maybe just an assumption from somebody? > > BR, > TomasHey Do you find the same behaviour when using $(''employer_id'').value, or even document.getElementById(''employer_id'').value() instead of $F(''employer_id'') ? It looks like prototype defines $F as Form.Element.getValue, maybe this rings a bell for someone else out there? Gustav Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 26 Mar, 21:46, Gustav Paul <gus...-PUm+PnBUKx7YkQIYctQFYw@public.gmane.org> wrote:> Tomasz Tomczyk wrote: > > On 23 Mar, 23:08, "Tomasz Tomczyk" <bomek...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> Hi, > > >> I found a problem with dynamic reading from input hidden. > >> To better explain my problem I will describe the process: > >> 1. user clicks a "select employer" link which opens dialog > >> 2. dialog is to select proper employer, which id is send back to rjs > >> via Ajax > >> 3. rjs sets a <input type=''hidden'' id=''employer_id'' > >> name=''employer_id''> with the proper value > >> 4. user clicks other link, which sends the employer_id taken from > >> $F(''employer_id'') > > >> So, for the first time the step 4 gives a proper value od employer_id. > >> But if I do the procedure once again (I select different emplyer_id) > >> the step 4 is giving me the same employer value, as at the beginning > >> (in first iteration). > > >> Using FireBug I can check, that the input hidden is having good values > >> any time I''m doing the procedure. Only reading from $F(''employer_id'') > >> is still the same (not changed). > > >> Any suggestions? > >> Tomasz > > > No suggestions at all? > > Maybe just an assumption from somebody? > > > BR, > > Tomas > > Hey > > Do you find the same behaviour when using $(''employer_id'').value, or > even document.getElementById(''employer_id'').value() instead of > $F(''employer_id'') ? > It looks like prototype defines $F as Form.Element.getValue, maybe this > rings a bell for someone else out there? > > Gustav PaulBingo !!! Working fine for document.getElementById(''employer_id'').value and even for $(''employer_id'').value I was pretty sure, that have checked it before, but it seems I haven''t. Thanks a lot ! By the way - why $F(''employer_id'') works only once? The form should be reset, or what? Tomasz --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---