# How to get radio\_button's value in link\_to\_remote

**URL:** <https://www.ruby-forum.com/t/how-to-get-radio-buttons-value-in-link-to-remote/107315>\
**Category:** Rails\
**Created:** [June 20, 2007, 1:10pm UTC](https://www.ruby-forum.com/t/how-to-get-radio-buttons-value-in-link-to-remote/107315 "2007-06-20T13:10:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![huang\_zhimin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/54ee81/32.png) [@huang\_zhimin](https://www.ruby-forum.com/u/huang_zhimin)\
**Post date:** [June 20, 2007, 1:10pm UTC](https://www.ruby-forum.com/t/how-to-get-radio-buttons-value-in-link-to-remote/107315/1 "2007-06-20T13:10:12Z")

</div>

My Code is here

\<% for category in @categories %\> \<% end %\>

| \<%= radio\_button 'category', 'id', category.id %\>\<%= h category.name %\> |

  
\<%= link\_to\_remote 'Edit', :update =\> 'category', :url =\> { :action =\> 'edit', :id =\> category[id]} %\>

I don’t get the radio\_button’s value, how can I get radio\_button’s value  
in  
link\_to\_remote?

–

> **[CodeLineStatistics](https://sourceforge.net/projects/mycodeline/)**
>
> Download CodeLineStatistics for free. The code line statistics takes files and directories from GUI, counts the total files, total sizes of files, total lines, lines of codes, lines of comments and lines of blanks in the files, displays the results...

---

<div class="post-metadata">

**Author:** ![huang\_zhimin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/54ee81/32.png) [@huang\_zhimin](https://www.ruby-forum.com/u/huang_zhimin)\
**Post date:** [June 20, 2007, 3:15pm UTC](https://www.ruby-forum.com/t/how-to-get-radio-buttons-value-in-link-to-remote/107315/2 "2007-06-20T15:15:39Z")

</div>

\<%= link\_to\_remote ‘Edit’,  
:update =\> ‘category’,  
:url =\> { :action =\> ‘edit’, :id =\> category[id]},  
:with =\> “‘id=’ + $(‘id\_of\_your\_element\_here’).value”  
%\>

😉

---

<div class="post-metadata">

**Author:** ![huang\_zhimin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/54ee81/32.png) [@huang\_zhimin](https://www.ruby-forum.com/u/huang_zhimin)\
**Post date:** [June 20, 2007, 3:16pm UTC](https://www.ruby-forum.com/t/how-to-get-radio-buttons-value-in-link-to-remote/107315/3 "2007-06-20T15:16:22Z")

</div>

oups… do not forget to delete your id from your :url hash 😉

---

<div class="post-metadata">

**Author:** ![huang\_zhimin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/54ee81/32.png) [@huang\_zhimin](https://www.ruby-forum.com/u/huang_zhimin)\
**Post date:** [June 20, 2007, 6:27pm UTC](https://www.ruby-forum.com/t/how-to-get-radio-buttons-value-in-link-to-remote/107315/4 "2007-06-20T18:27:10Z")

</div>

There is still a problem. I inspect the DOM, that is

 root root2 root3 root4 

as you can see, I can’t use $() to get the radio value because the id is  
dynamic created

On 6/20/07, Titou T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> oups… do not forget to delete your id from your :url hash 😉
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–

> **[CodeLineStatistics](https://sourceforge.net/projects/mycodeline/)**
>
> Download CodeLineStatistics for free. The code line statistics takes files and directories from GUI, counts the total files, total sizes of files, total lines, lines of codes, lines of comments and lines of blanks in the files, displays the results...
