Displaying 20 results from an estimated 5000 matches similar to: "radio buttons => What if the value is a FK?"
2007 Feb 03
7
Interesting radio button behavior with "onclick"
Hello:
I have radio buttons like this:
<% fields_for :goalhist do |g| %>
<table>
<tr>
<td align=left><%= radio_button_tag (''duedate'', 0, checked = false,
options = {:onclick => ""}) %>
Start now
</td>
</tr>
<tr id="detailed" style="display: none"><td colspan=2>
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 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
2006 Mar 10
0
Multiple radio buttons for defining multiple objects?
Hi, I''ve been working on a multiple choice Question/Answer system. The
response object (analagous to a lineitem) has a question_id, user_id,
and the actual response. What''s a good way of making a form with
multiple response objects which are created from the radio_button
helper?
Right now I''ve got the following code:
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
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 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") %>
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 =>
2008 Jun 04
2
div and loop help
Hello,
I want to display a effect.slidedown in a table.
I have a table called contactnotes.
<table>
<%@contactnotes.each do |contact|%>
<tr>
<td><%= link_to(@person.first_name, "#", html_options={:onclick =>
"Effect.SlideDown(''show_details_of_contact_note''); return
false;"})%></td>
</tr>
...
<tr>
<div
2005 Jun 24
3
flashing divs in IE with use of BlindUp and BlindDown
I''m having an issue with flashing divs in IE (firefox is fine and the
only other browser I''ve used)
My scenario is as follows. I have 2 divs (initially hidden) and using
the BlindDown and BlindUp functions (possibly others) the divs flash
when starting to roll down in BlindDown (due to the Element.show call)
and also at the end of the BlindUp call (due to the Element.hide call)
2007 Jun 09
7
create 2 fk referencing the same table
Hi everyone! I have a problem with defining 2 fk referencing the same
table. I have a Program table and a Team table. The Program should
have an away team and a home team fk. From my understanding, "the fk
column should be named after the class of the target table, converted
to lowercase, with _id appended". But, in my case, I have 2 fk
referencing the same table. How can I do this?
2006 Feb 22
2
''this.initialize'' is null or not an object
Hi, working on the accordion widget and it''s actually working nice (doesn''t
seem to be jumpy) now but I am receiving a javascript error in IE 6. Does
anybody have any ideas why it is happening? Thanks
<script language="javascript">
sbr_stretch(el) {
thisBodyId = el.parentNode.id + "_body";
thisBody = $(thisBodyId);
if
2005 Dec 03
1
SlideDown/SlideUp question
Hi ,
i jotted down this script here
http://awstagingserver.net/snehal/ajax/prototype/rssget/news.asp#
its a RSS reader thing , what i am trying to achieve here is save
browser space here by using SlideDown and SlideUp , as you might see
whats happening with the script when you click on the newsbar name ,
what i want is when initially WorldNews is displayed and when you
click on Slashdot ,it
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 Jan 10
0
bug? : STI and :include => fk and class_name MUST be specified
I suspect this is a bug. Or a limitation.
Problem:
----------------
When you include a STI class in a ''find'' :
@results = Result.find :all, :include => :event
, you are forced to specify the fk and the class name :
belongs_to :event , :class_name => "Event", :foreign_key =>
"event_id"
.
Full code:
-----------
class Event <
2006 Mar 11
2
assignment of parent ID in child''s fk field
When I create a child record I''m not automagically getting the parent ID put into the fk field. Does object.new take parameters that allows me to do that as part of the AR record creation? Or do I need to do it separately? Or am I missing the boat altogether ;-)
Thanks,
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: