Forum: Ruby on Rails Is reading from input hidden cached somehow?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eaec1838b76398f2b3e91ada57ac0a73?d=identicon&s=25 Tomasz Tomczyk (Guest)
on 2007-03-23 22:11
(Received via mailing list)
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
Eaec1838b76398f2b3e91ada57ac0a73?d=identicon&s=25 Tomasz Tomczyk (Guest)
on 2007-03-26 21:26
(Received via mailing list)
On 23 Mar, 23:08, "Tomasz Tomczyk" <bomek...@gmail.com> wrote:
> $F('employer_id')
> Any suggestions?
> Tomasz


No suggestions at all?
Maybe just an assumption from somebody?

BR,
Tomasz
19605c7ede229e507e894865308a6d53?d=identicon&s=25 Gustav Paul (Guest)
on 2007-03-26 21:49
(Received via mailing list)
Tomasz Tomczyk wrote:
>> name='employer_id'> with the proper value
>> is still the same (not changed).
> 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 Paul
Eaec1838b76398f2b3e91ada57ac0a73?d=identicon&s=25 Tomasz Tomczyk (Guest)
on 2007-03-26 23:50
(Received via mailing list)
On 26 Mar, 21:46, Gustav Paul <gus...@rails.co.za> wrote:
> >> 3. rjs sets a <input type='hidden' id='employer_id'
> >> any time I'm doing the procedure. Only reading from $F('employer_id')
>
> 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 Paul

Bingo !!!

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
This topic is locked and can not be replied to.