Re: Accessing form elements

Thorsten Mueller
Thu, 05 Jun 2008 17:17:59 -0000

> Oh so it keeps everything client side so it wont be as slow and then the
> value will get passed in with the form.  So, I can just put a call to a
> javascript method inside the hidden field for :value => and it will get
> passed through correctly.

ok, it depends on how exactly you use the hidden field (and if it''s
hidden_field or hidden_field_tag)

most simple case:

<%= hidden_field_tag ''number'' %>

will generate:

<input id="number" name="number" type="hidden"
/>


so the number can define an
onchange = "$(''number'').value =
''1''"

the id/name may depend on your setup, but just have a look at the
generated html to get that.