Displaying 20 results from an estimated 27 matches for "radio_button_tag".
2008 Aug 21
4
radio_button_tag - examining the selected value
Hi All
I have four radio buttons created like this
<%= radio_button_tag :answers, 1, false %> a <br/>
<%= radio_button_tag :answers, 2, false %> b <br/>
<%= radio_button_tag :answers, 3, false %> c <br/>
<%= radio_button_tag :answers, 4, false %> d <br/>
And then I have a link_to tag to invoke a cont...
2007 Oct 11
3
radio_button_tag
Hello
I have a view which have 2 radio buttons :
...
<td style="width:5%">Actuel</td>
<td style="width:10%"><%= radio_button_tag(:actuel, value = "1", checked
= false, options = {}) %>
<td style="width:5%">Last</td>
<td style="width:10%"><%= radio_button_tag(:last, value = "1", checked =
false, options = {}) %></td>
...
I dont know how to proceed to co...
2006 Jan 27
1
radio_button_tag quirkiness...
...or my ineptitude?
I found that the following is always checking the last ''things'' button
regardless of the value of query.table:
People:<%= radio_button_tag("query", "table", "P") %>
Animals:<%= radio_button_tag("query", "table", "A") %>
Things:<%= radio_button_tag("query", "table", "T") %>
But the following works correctly:
People:<%= radio_bu...
2012 Apr 18
2
RoR - Search Forms with Checkboxes, display appropriate results
...nd
My index view:
<%= form_tag hotels_path, :method =>''get'' do%>
<p>
<b>Location:</b>
<%= text_field_tag :search, params[:search]%><br />
<b>Rating:</b><br />
<%= radio_button_tag :rating, ''5''%>5 Stars<br />
<%= radio_button_tag :rating, ''4''%>4 Stars<br />
<%= radio_button_tag :rating, ''3''%>3 Stars<br />
<%= radio_button_tag :rating, ''6'&...
2010 Jan 23
0
Problems with :onchange for radio_button_tag
...hitting my head to the wall over this for quite a while now
and don''t seem to be able to wrap my forementioned head around it.
Basically I have a list of users in a selection box and I have two radio
buttons: Sort by first name and sort by last name. This is what I have
in my view:
<%= radio_button_tag ''sort_by_last_name'', ''true'', :checked => true,
:onchange => ''#{remote_function(:url => {:action =>
"update_users"},
:with => "order=1")}'' %> Sort by Last name<br />
<%= radio_button...
2006 Jun 21
5
newbie - question on radio_buttons
I have a view with a form and i want to be able to process the button
selected in a controller - not sure how to do this. The form does not
map directly to a model - all I want to do is be able to pass back the
selected button and know which one it is.
So, i have a form and several radio buttons - the submit (not shown)
takes me to the process_answer action where I want to determine which
2006 Mar 24
1
Radio Button Tag and hash @Params.
...em using the Radio Button Tag.
I use the " @prove=MODEL.column_names() " to keep attribute names of a
table. After
i used this code to select a attribute subsets of them :
<% i=''0''%>
<% for @obj in @prove %>
<% @key='':key''+i%>
<%= radio_button_tag (@key,@obj) %>
<% i=i+''1'' %>
<% end %>
<%= submit_tag ("calca") %>
<%= end_form_tag %>
But when i come back to the controller, it''is impossible select the
right radio button value with the code :
@result=@params[@key];
Th...
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='' + $F(''citi'')",
:url => {...
2008 May 11
3
radio_button_tag and default checked option
Hi, I can''t get my radio button to be checked by default, here is what I
have:
<%= f.radio_button :gender, "male", :checked => ''true'' %><p>Male</p>
<%= f.radio_button :gender, "female" %><p>Female</p>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received
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>
</td></tr>
<tr>
<td align=left><%=...
2008 Apr 09
3
form_tag and form_for cause #protect_from_forgery errors
...its own keys (Cookie Session Store).) on line #2 of
users/new.fbml.erb:
1: <h1>Welcome To Courses, Let''s Get Started.</h1>
2: <% form_for :user, user_path, :method => :post do |form| %>
3: <fb:editor-custom label="You are a">
4: <label><%= radio_button_tag ''user_type'', ''student'', true %>
Student</label>
5: <label><%= radio_button_tag ''user_type'', ''instructor'' %> Teacher</
label>
vendor/rails/actionpack/lib/action_controller/
request_forgery_...
2009 Feb 26
8
beginners question
...have this feeling that it is not
exactly how it should be done in rails. Appended to this mail is my
app/views/item/edit.html.erb. Comments/suggestions welcome!
Especially the javascript part is bothering me: should it really be
included in the html.erb file and at that point? Another thing is the
radio_button_tags with the onclick. This is not good, is it?
thanks in advance, Ruud
===========================
edit.html.erb (hopefully the tags are preserved in the mail)
<h1>Editing item</h1>
<script type=''text/javascript''>
function date_clicked (noDate)
{
var doc = w...
2007 Apr 03
3
end_form_tag
...rk.
THIS WORKS:
<%= form_remote_tag :url =>{:action => "next_question",
:kwiz_id => @kwiz.id,
:position => @next_position} %>
<% @question.choices.each do |choice| -%>
<%= radio_button_tag "choice_id", choice.id %>
<%= choice.name %><br />
<% end -%>
<br />
<%= submit_tag "Next Question" %>
<%= end_form_tag %>
THIS DOES NOT WORK:
<%= form_remote_tag :url =>{:action => &q...
2008 May 16
3
radio button observe field only triggers once
...fields in a form that i need
to know if one of them changes and which spedific field. Below is an
example of two foelds i tested and they trigger once with the alert but
then nothing after that. I also tried individual observers for each
field test_yes and test_no but with the same issue.
<%= radio_button_tag ''test'', "yes" %>
<%= radio_button_tag ''test'', "no" %>
<%= observe_field(''test'',
:on => ''click'',
:function => "alert(''Element Yes changed&...
2013 Jun 18
1
How to Pass Jquery selected dropdown values and radio button values to controller
Hi,
I have an advance search page and its code is as follows -
I have written my code like this
<div class="container">
<%= form_tag search_index_path, method: :get do %>
<%= radio_button_tag ''user_type'', ''customer'' %><p>Customer</p>
<%= radio_button_tag ''user_type'', ''supplier'' %><p>Supplier</p>
<% end %>
<h2>Search Criteria</h2>
<div id="dropdow...
2006 Apr 08
0
Understanding observe_form...
...39;d be indebted.
In my view, I have a form:
<%= start_form_tag({:controller => ''houses'', :action => ''find''}, {:id
=> ''advanced_search'', :method => :get}) %>
<p>How much are you willing to spend?</p>
<%= radio_button_tag :price, "small" %> a bit
<%= radio_button_tag :price, "medium" %> a lot
<%= radio_button_tag :price, "any" %> the sky''s the limit!
..other options follow..
<%= end_form_tag %>
The first option is "price", a set of radiob...
2006 Aug 04
2
observe_field for radio_button
...eld like this:
<%= text_field :user, :select, "size" => 20, "maxlength" => 16 %>
But I want a radio button, and what I have is this:
<%= radio_button("user", "select", user.id) %>
The above doesn''t work and neither does:
<%= radio_button_tag("admin", "select", user.id) %>
----------
I ahve no clue why the radio buttons don''t work with the observer. Any
help would be greatly appreciated!
Thanks,
Aditya
--
Posted via http://www.ruby-forum.com/.
2006 Mar 01
4
another select_list question - bad bad booleans
I have a select list for a boolean column in postgresql
in the ''model'' ...
YES_NO = [
[ "Yes", "1" ],
[ "No", "0" ]
].freeze
in the ''view code'' ...
<%= options = [[''Accepted?'', '''']] + Placement::YES_NO
select("placement", "accepted",
2006 Jul 01
4
Radio_button in loop problem
...question.option_two.id)
%>
<%= question.option_two %>
<% end %>
The "debug question" statement prints out the correct values. I have to
think that I''m using the wrong parameters in the radio_button call, but
nothing I try is working.
I guess I could use the radio_button_tag builder but radio_button seems
better. Any help would be greatly appreciated!
Thanks,
Eugene
--
Posted via http://www.ruby-forum.com/.
2009 Apr 12
3
Multi-button form
It cannot be this difficult, especially in rails. Here is my form code
in a partial for the index action of a controller:
<% form_tag({:controller => controller_name, :action => ''index''},
{:method => :get, :class => ''form''}) do %>
<div class="columns">
<div class="column left">
<p>