similar to: Problem with observe_field

Displaying 20 results from an estimated 3000 matches similar to: "Problem with observe_field"

2006 Mar 01
1
observe_field question
I''m sure this is a simple problem, but I''ve been working on it for a couple days and can''t seem to figure out the correct way to structure my observe_field call. The HTML and Javascript generated all appear correct, but the AJAX call is never made. Below is the code I''m using and any help would be much appreciated. models_controller.rb def
2006 May 23
1
Help with observe_field
Folks, When I use observe_field, I get a javascript error "Form is not defined". Any thoughts? __View: search.rhtml__ <label for="search">Search:</label> <%= text_field_tag :search %> <%= observe_field(:search, :frequency => 0.25, :update => :search_hits, :url => { :action =>
2010 May 28
8
form helpers don't seem to work with RJS files...
I’ve been spending a great deal of time chasing this problem. Hopefully someone sees something obvious I’m doing wrong. Basically anytime I try to call fields_for from an RJS file or within a partial in the RJS file, I get the following error. My goal is simply to load a partial into a div. The fields in this partial require fields_for though. And that’s where the problem lies.
2006 Jul 11
9
problems with observe_field
Hi all, I''m having problems with an observe_field, this is the view: <%= form_tag %> <div id="content"> <p>Customer: <select name="cliente_id" id="cliente_id"> <option value="">Select a customer</option> <%= options_for_select Cliente.find_all.collect {|c| [c.razon_social, c.id]} %>
2007 Oct 26
2
Appending to a textarea with RJS
Ok, this is driving me nuts. I''m trying to RJS some text into a text_area which may or may not have been written in by the user. if I page.insert_html :before, :after, :top, or :bottom, it either sticks the contents above or below the text box (but never in). If I do: page[:textboxid].value = "blah" it overwrites the contents of the textbox but doesn''t APPEND to it.
2006 Aug 15
4
observe_form not serializing form
I want to use observe_form to automatically save notes in a text_area. This is the code I have: <form id=''notes_form''> <%= text_area :contact, :notes, :cols => 40, :rows => 10, :id =>''notes_text_area'' %> <%= observe_form(''notes_form'', :frequency => 1,
2006 Jul 12
1
Getting the value of a text area
I have a form where the user will type in some text in a text area. When this form gets submitted, all of the info gets pushed into a MySQL table. The text area in question can have HTML and special formatting. I want to create a preview div for this. I can use observe_field to preview the formatting as they type, but I''d rather have it set so that they can click a "Preview"
2006 May 22
4
use join table in paginate
How come I allways immediately run into difficult stuff when I''m trying some new programming language? Am I blind for the simplicity of Ruby/Rail, which a see must be there? Anyway, don''t try and answer this rhetoric question. I have got another one for you, seemingly difficult. I''m struggling with a n:m relationship (in a database, that is) and its join table.
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='' +
2006 Apr 23
5
Newbie Ajaxy Question
Hi all, I''ve been trying to figure this out by myself and while I feel I''ve made some progress, I feel kind of stuck. Let me see if I can explain what I''m trying to do. I have a very simple form with a text box and a text area. The text in each of these will eventually make it into a row in a table in my database. For now, the value in the text box represents a
2009 Jun 14
6
Unable to make observe_field work
I can''t make it work. <%= text_field_tag :friend %> <%= observe_field :friend, :url => friendships_url, :on => :click %> <%= javascript_include_tag :defaults %> Raises the error:Can''t find variable Form. The generated html is: <input id="friend" name="friend" type="text" /> <script
2006 Aug 07
2
Select Box Question
Hi, Yet another newbie here... I''m writing an appliction in Rails, and I''ve Ajaxified my select boxes so they update dynamically. I used the "observe_field" method to monitor changes to my select box. I find that it''s kind of erratic... it updates constantly and makes the selection for me, based on where my mouse happens to be hovering when it does its
2006 Jul 12
2
Can''t get observe_field to take a variable for a field name
The subject pretty much says it all: I can''t?get observe_field to take a variable for a field name I''ve tried: <%= observe_field(var_name, ... <%= observe_field("#{var_name}", ... <%= observe_field(:"#{var_name}", ... No luck. Am I missing something? Thanks, : ) Jason -- Posted via http://www.ruby-forum.com/.
2005 Dec 31
4
observe_field with dynamic forms
I have a form where I dynamically add form elements based on user input. An example is that when a user selects a "server" from a select box I add (via AJAX calls back to server) a "type" select box pre-populated with valid choices for that server. I do this by using observe_field on the "server" field and update a div on the page with the new "type"
2008 Apr 15
2
Asking for help passing variables with an observe_field
Hi, I have the following observe field: <%= observe_field :session_treatment, :url => { :action => ''retrieve_rate'' }, :with => ''treatment'' %> This passes on the ''treatment'' variable to the action, but I''d like to pass another variable and I''m having a hard time figuring out how to write it. Any help would be
2008 Feb 27
2
observe_field not generating any script
Hi - I have a view: <% content_for(:page) do %> <h1>New user</h1> <% form_for :user, @user, :url => { :action => "create" } do |form| %> <%= render :partial => ''form'', :locals => { :form => form, :genders => @genders} %> <%= submit_tag "Create" %> <%end%> <%
2006 Aug 04
2
observe_field for radio_button
Hi, I need to observe a set of radio buttons but am having great trouble. My observe_field looks like this: <%= observe_field :user_select, :frequency => 0, :url => { :action => :admin_control } %> Now it works fine if I use a text_field like this: <%= text_field :user, :select, "size" => 20, "maxlength" => 16 %> But I want a radio button, and
2008 Dec 22
2
how to use the observe_field to get more than one field?
Hi, I have two selctdropdown boxes name like "resolution" and "codecname". Now i am able to get the single field value either from resolution or codecformat select box. ex: observe_field ''resolution'' or observe_field ''codecforamt'' is there any way to get the two fields in to the observe_field method ? Can anyone give me suggestionfs or
2008 Jun 19
5
observe_field
I have been trying to pass a collection_select parameter and a text field parameter to observe_field so that it watches both the parameters simultaneously. but what i can see is , when i select some value from drop down and dont write anything in text field its giving correct results.parameters are also correct passed, but just after that if i write something in text field that value also get
2006 Jul 21
4
observe_field submit behavior
I am using observe_field on a number of multi-selects and checkbox form elements whose values would normally come in as arrays on a normal (non-Ajax) form post. I understand that by using the :with => ''name'' I will get name=value in the request.raw_post however if the field I am submitting has mutliple values and the name is of the form ''name[]'', I get