Displaying 20 results from an estimated 1000 matches similar to: "Multiple radio buttons for defining multiple objects?"
2006 Mar 17
5
Radio Button Validation
I''m writing a quiz application and I need to validate the radio button
reponses. I do not have the questions in a database, I just have forms
which contain "question1" and then I strip out the "question" portion
and just insert the number as the question''s id. So now I''m faced with
the dilemma of making sure the radio buttons are pressed.
Radio
2006 Jul 01
4
Radio_button in loop problem
Hi all, I can''t figure out why my radio_buttons won''t reflect the values
stored in my database. I read through some of the previous posts -- is
it true that they don''t work with integers?
This is the code I''m using:
<% for question in @survey.questions %>
<%= debug question %>
<%= radio_button ( "question", :question_id,
2008 Mar 23
1
radio buttons - how to identify record using value?
I''m making a simple questionnaire app using RoR. I''ve got a model for
Questions, a model for Answers, and a third model, Qa, for matching each
question to five possible answers through foreign keys. So, each qa has
a question and five answers , a1-a5, through belongs_to and a
:foreign_key, and then a selected_answer field for specifying which
answer was selected by the user. The
2007 Jan 31
0
radio buttons => What if the value is a FK?
Hi:
I have radio buttons like this in my view:
<%= radio_button :goals, :goaltype_id, ''Recurring'', { :onclick => "new
Effect.SlideDown(''recurring''); return false;" }
%> Recurring<br />
<%= radio_button :goals, :goaltype_id, ''One-time'', { :onclick => "new
2006 Aug 10
3
Radio buttons refusing to load checked...
Hi,
Having big problems with radio buttons that just don''t make sense:
<%= radio_button "events", "impact_type", true %> Positive
<%= radio_button "events", "impact_type", false %> Negative
This should create two radio buttons with the first one checked by
default, right? Cos it doesn''t :(
Any ideas would be great,
Thanks,
2009 Apr 28
0
Radio buttons in forms
<% form_for @group do |g| %>
To create a new group please complete the details below
<p>
<label> Group Name </label>
<%= g.text_field :name %>
</p>
<p>
<label> Public </label>
<%= g.radio_button :type, "public" %>
<label> Private </label>
<%=
2011 Nov 20
3
Use Ransack with radio buttons for boolean values
Hello
I''m trying to search for active and non active users. These radio buttons
work just fine except that it didn''t reselect itself after the form has
been submitted. So, what should I do to ensure it will be selected just
like how my text field populated automatically after the form has been
submitted?
= search_form_for @q do |f|
= f.radio_button :is_active_false, 1
=
2007 Feb 27
2
Dynamically add radio buttons to forms?
Good afternoon all
I''m trying to implement a form that dynamically inserts radio buttons
into a form. The user selects options from a drop-down menu. I use
observe_field to watch for a change and call back to render the
appropriate partial tha contains the radio options. All works nicely
but I''m tripped up on one thing:
When rendering a form using form_for how do I link those
2006 Mar 22
2
Radio Button Defailt Value?
I have:
<%= radio_button ''foo'', ''bar_id'', ''1'' %>
<%= radio_button ''foo'', ''bar_id'', ''2'' %>
<%= radio_button ''foo'', ''bar_id'', ''3'' %>
I would like to have option #3 be selected if foo.bar_id is nil. Is
there a way to do
2007 Aug 04
0
capturing radio button values for nested object
I have a user object and an account object. User has one account
object. In the signup.rhtml I have a radio button that has three
options for the membership (yearly, monthly and sample). How do I
populate the account model when the user submits the form?
Is the following syntax correct?
<%= radio_button("user[account]", "membership", "Yearly") %>
2006 Aug 01
3
Radio buttons and AJAX
Hi,
Here is what I would like:
2 radio buttons:
"yes" and
"no"
There will be 2 containers:
<div id="yes" style="display: none;">Yes stuff</div>
<div id="no" style="display: none;">No stuff</div>
What I want is whenever the "yes" radio button is selected, on the "yes"
div should be made
2008 Jul 21
0
edit radio button values...
my problem is... during edit process radio button should be checked as
default ..how can i do that ..pl help..
my edit .erb file
<% form_tag (:action => ''update'', :id => @mobile )do%>
<p><label for="book_title">Title</label>:
<%= radio_button ''mobile'', ''brand'', ''yes'' :checked =>
2006 Jan 19
8
Passing variables across forms
I''ve been reading my Agile Dev book over and over again, but I can''t
wrap my head around how to do this. There''s a question and answer
portion site of my site. You begin the process by adding a question to
the database. After that, the program should redirect you straight to
adding an answer for that question. The problem is, I don''t know how to
keep
2007 Sep 14
2
how to use options in radio botton
Hi I am using radio botton,I am struggling to use options..following is
my code..
<%=
radio_button(''community'',''default'',0,options={:checked,:onClick=>"javascript:set_default(this);"})%>
If i am using without checked option its working fine.If i use that its
throwing error....
Please help me
--
Posted via http://www.ruby-forum.com/.
2006 Apr 04
2
Syntax Error in find()
Maybe I misunderstand the parameterization of find(), I am getting this
syntax error for
<% @choices = Choic
e.find(:all, :conditions => "question_id" = question.id, :order =>
"order") %>
---- ERROR LOG ----
ActionView::TemplateError (compile error
../config/../app/views/admin/test/show.rhtml:37: syntax error
_erbout.concat " "; @choices =
2006 Jul 21
1
How to dynamically add more rows and submit data
Let''s assume that I am trying to build an application where the user can
enter invoice.
In the app the user can add lines items. Each line item has decription,
date, rate and hours.
When the invoice screen comes up the first time I have one blank row for the
line items.
<tr>
<th>Description</th>
<th>Date</th>
2006 Jul 06
0
radio_button with boolean fields does not work with postgresql
I don''t know what I am doing wrong. I have a User class with a
"send_message_emails" boolean field. The value for this is true. In
postgresql this is stored as a "t" in the database. In Rails this field is a
boolean and is set to true, but for some reason the following code is *not*
working... the radio_button is not selected.
<%= radio_button "user",
2006 May 31
2
Storing a NULL value from a radio_button
Hi, I''ve a boolean database field (tinyint(1)) wich allows nulls.
Then, I''ve something like this:
radio_button(''server'',''customer_has_login'',"NULL")
radio_button(''server'',''customer_has_login'',true)
radio_button(''server'',''customer_has_login'',false)
The problem is
2006 Jan 04
4
many to many link table compound primary key explosion
Hi,
I have a many-to-many relationship between two tables, questions and
answers. My MySQL schema for the link table creates a primary key from
the two fields to prevent duplicate records. When I add the same answer
to the same question more than once, rails attempts to create a
duplicate record and explodes with a MySQL error:
MysqlError: Duplicate entry ''3-3'' for key 1:
2006 Jun 28
3
observe_field and radio button... does not work?
I try to catch click event on radio button, but nothing is executed....
Tested with RoR 1.1.2 and 1.1.3. What am I doing wrong?
<%= radio_button_tag(:city, ''Dublin'') %>
<%= observe_field(:citi, :frequency => 0.5,
:on => ''click'',
:with => "''city='' +