# List of radio buttons

**URL:** <https://www.ruby-forum.com/t/list-of-radio-buttons/188948>\
**Category:** Rails\
**Created:** [May 20, 2010, 11:47pm UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948 "2010-05-20T23:47:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Smok](https://www.ruby-forum.com/u/Smok)\
**Post date:** [May 20, 2010, 11:47pm UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948/1 "2010-05-20T23:47:58Z")

</div>

I need to create in RoR 2.3.5 a list of questions ( the number of  
questions will be changing). The answers will be near to each of the  
these questions in radiobuttons (let’s say 3 radios near each of  
thequestions). After having compleated all of these questions I would  
like to read all the answers and using ONE update insert them to the  
database(mySQL). Is it possible to create this functionality without  
js?

Kind regards,  
Smok

---

<div class="post-metadata">

**Author:** ![Smok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Smok](https://www.ruby-forum.com/u/Smok)\
**Post date:** [May 21, 2010, 12:20am UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948/2 "2010-05-21T00:20:47Z")

</div>

On Thu, May 20, 2010 at 2:46 PM, Smok [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need to create in RoR 2.3.5 a list of questions ( the number of  
> questions will be changing). The answers will be near to each of the  
> these questions in radiobuttons (let’s say 3 radios near each of  
> thequestions). After having compleated all of these questions I would  
> like to read all the answers and using ONE update insert them to the  
> database(mySQL). Is it possible to create this functionality without  
> js?

Of course. You’re describing a basic form. Why would you think you  
need JavaScript to submit it and process the data?

Or am I misunderstanding your goal?

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![Smok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Smok](https://www.ruby-forum.com/u/Smok)\
**Post date:** [May 21, 2010, 4:20pm UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948/3 "2010-05-21T16:20:17Z")

</div>

On 21 Maj, 00:19, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> need JavaScript to submit it and process the data?
> 
> Or am I misunderstanding your goal?
> 
> –  
> Hassan S. ------------------------ removed\_email\_address@domain.invalid  
> twitter: @hassan

Thanks Hassan for your answer. However I don’t know how to define the  
radiobuttons (in such a way that a different answer can be checked for  
different questions). And I don’t know how to read all the user’s  
answers. Could you try to paste a bit of code?

---

<div class="post-metadata">

**Author:** ![Smok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Smok](https://www.ruby-forum.com/u/Smok)\
**Post date:** [May 21, 2010, 5:25pm UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948/4 "2010-05-21T17:25:57Z")

</div>

Smok wrote:

> On 21 Maj, 00:19, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > need JavaScript to submit it and process the data?
> > 
> > Or am I misunderstanding your goal?
> > 
> > –  
> > Hassan S. ------------------------ removed\_email\_address@domain.invalid  
> > twitter: @hassan
> 
> Thanks Hassan for your answer. However I don’t know how to define the  
> radiobuttons (in such a way that a different answer can be checked for  
> different questions). And I don’t know how to read all the user’s  
> answers. Could you try to paste a bit of code?

No, first learn about HTML form syntax (hint: the “name” attribute is  
significant here) and read the Rails documentation. If that doesn’t  
work, show us what you’ve done so far and what problems you’re having.  
Asking for code without “doing your homework” first will usually get you  
ignored here.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Smok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Smok](https://www.ruby-forum.com/u/Smok)\
**Post date:** [May 23, 2010, 4:14pm UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948/5 "2010-05-23T16:14:10Z")

</div>

On 21 Maj, 17:28, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> an excellent place to start…
> 
> –  
> Hassan S. ------------------------ removed\_email\_address@domain.invalid  
> twitter: @hassan
> 
> –  
> You received this message because you are subscribed to the Google G. “Ruby on Rails: Talk” group.

Thanks guys for your responses. For the future - it would be great if  
you could to give some kind of hint or high level description how to  
approach soloving the problem. Such as reading about FORM, some links  
would be great. Thanks !

---

<div class="post-metadata">

**Author:** ![Smok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Smok](https://www.ruby-forum.com/u/Smok)\
**Post date:** [May 23, 2010, 5:25pm UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948/6 "2010-05-23T17:25:34Z")

</div>

On Sun, May 23, 2010 at 7:13 AM, Smok [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 21 Maj, 17:28, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I was going to suggest that the OP has apparently never read this  
> > [http://www.w3.org/TR/html401/interact/forms.html](http://www.w3.org/TR/html401/interact/forms.html) and that it’d be  
> > an excellent place to start…

> Thanks guys for your responses. For the future - it would be great if  
> you could to give some kind of hint or high level description how to  
> approach soloving the problem. Such as reading about FORM, some links  
> would be great. Thanks !

Uh, isn’t that exactly what I did? 🙂

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![Smok](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@Smok](https://www.ruby-forum.com/u/Smok)\
**Post date:** [May 21, 2010, 5:29pm UTC](https://www.ruby-forum.com/t/list-of-radio-buttons/188948/7 "2010-05-21T17:29:57Z")

</div>

On Fri, May 21, 2010 at 8:25 AM, Marnen Laibow-Koser  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> No, first learn about HTML form syntax (hint: the “name” attribute is  
> significant here)

Heh. Beat me by a minute 🙂

I was going to suggest that the OP has apparently never read this  
[http://www.w3.org/TR/html401/interact/forms.html](http://www.w3.org/TR/html401/interact/forms.html) and that it’d be  
an excellent place to start…

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan
