search for: after_update_element

Displaying 15 results from an estimated 15 matches for "after_update_element".

2006 Apr 16
2
:after_update_element on text_field_with_auto_complete
I have a a basic prototype coded: #view <%= text_field_with_auto_complete :student, :last_name, { :size => 15 }, :after_update_element => "alert(''hello world'');" %> #controller class ScoresController < ApplicationController auto_complete_for :student, :last_name end If I take out the :after_update_element option everything works as advertised. However, with :after_update_element specifie...
2007 Jul 17
0
text_field_with_auto_complete :after_update_element not firing
...text_field_with_auto_complete and it works great. It talks to my controller correctly, firing my method that queries mySQL and returns a nice <ul> to select from all with CSS. Ok great. Now I want to be able to capture the ID of the item that the user will select from. I have tried using :after_update_element as described on script.aculo.us and elsewhere on the web. No luck. It never seems to fire. As a test I created a javascript file (placed it in the javascripts folder, and include it in my header) that looks like this: function get(text, li) { alert(li.id); } Then I call this function from my...
2006 Apr 02
13
autocompletion: hooking ''afterUpdateElement'' in Rails
...scriptaculous doc, I figured out ''afterUpdateElement'' is the place to be but I wonder if/how and where I can hook my javascript code to this event in Rails code (I''d like to keep using the helper, if possible)? I tried passing many variations of :after_update_element=> "alert(''after_update_element action'')" in _text_field_with_auto_complete_ and _auto_complete_field_ to no avail. Any hint? TIA Alain
2006 May 31
3
textfield_with_auto_complete - filling two fields
I am going nuts here.. I have a form where users can write a city name (used with auto_complete) - and once they click on the desired city in the dropdown menu - I would like to have the Country field filled automatically as well... Is this possible at all ? If so, can somebody please tell me where I can find some documentation on the subject, or preferrably an example ? Many thanks in
2006 Apr 01
1
piggybacking an action on an autocompleted field
Hi everybody, I''d like to add a custom action to be triggered after/when an autocompleted field has been/is beeing updated by the autocompletion process. I tried the obvious - a field observer -, but it doesn''t work (see code below). I know I could write the autocompletion code myself, but I wonder if there is a simpler/more elegant way? Any idea? TIA Alain The
2006 Jun 23
0
Re:(RESOLVED, KIND OF) auto complete and after update element
Well, I did finally get the after_update_element to call my controller action with the following syntax: <%= text_field_with_auto_complete ( :customer, :company_name, { :size => "45" }, :after_update_element => "function(element,value){" + remote_function( :url => { :action...
2006 Aug 07
0
multiple text_field_with_auto_complete in IE/Opera
...autocomplete box in a row to update info in that row. I noticed that all of them get the same id and name attributes (user_uid and user[uid]). This doesn''t cause a problem in firefox 1.5 on windows. However on IE 6/Opera 9 I can only get autocomplete in the first box, and that box on :after_update_element affects all the rows. In firefox this is working flawlessly (though I wonder how, since ids are all the same). The obvious solution is to give different id to each. That breaks the autocomplete totally, as it is expecting id to be user_uid. My :after_update_element correctly refers to a the co...
2006 Aug 07
1
Escape ''&'' in text_field_with_auto_complete
...; :company_name => "Barnes ", :Nobel => "" Expected/Desired result ==> :company_name => "Barnes & Nobel" Code in view: <%= text_field_with_auto_complete :supplier, :company_name, { :size => "45", :value => @supplier.company_name }, :after_update_element => "function(element,value){" + remote_function( :url => { :action => :get_supplier_address }, :with => "''supplier=''+escape($F(''supplier_company_name''))") + "}" %> controller: def auto_complete_for_su...
2006 May 26
5
scriptaculous - auto complete textbox with a drop down
Hi, I''m using scriptaculous to provide an auto complete textbox - and it works perfectly - but I was wondering if there was anyway to let users navigate the choices using the keyboard i.e the curor keys as opposed to having to use the mouse? Apart from that it''s perfect! :) Cheers, Pete -- Posted via http://www.ruby-forum.com/.
2006 Mar 09
15
regular expressions slay me
I am furiously trying to find what I am looking for in Pickaxe book and not finding it. I''m getting some values back from a posted form and I need to get the ''id'' number off the backend. The ''String'' will always come back to me as... Some_name\r\n123 where 123 is actually the id number which I need to execute the find. The reason they are coming back
2006 Jun 23
0
auto complete and after update element
...several searches via the web and all of my 13,000+ emails from the rails list. I can''t seem to find or discover exactly why the below syntax does not cause the app to call the get_supplier_address action in the controller. <%= text_field_with_auto_complete ( :supplier, :company_name, :after_update_element => "function(element,value){" + remote_function( :url => { :action => :get_supplier_address }, :with => "''supplier=''+value") + "}" ) %> The text field with auto complete works beautifully. I sel...
2006 Feb 16
2
Autocompleter question
Hey all, When using the Ajax.autocompleter, how would I configure it so that the user is searching based on an entry''s name, but once they select an entry, I record the ID? I have the user entering a person''s name in a text box to make it easier to find contacts in a large database. I know that I can display content that doesn''t end up in the textbox by using
2006 Mar 08
6
Difficulty with params hash and submit_to_remote
Hi, Is there any trick to initializing the params hash via submit_to_remote()? I have a form with two submit methods - the regular, non-AJAX method, and the AJAX method. The regular method works like a champ. The submit_to_remote invokes the correct controller, but the params hash is empty except for the values for :action and :controller. I''d show my code, but it''s on
2008 Feb 07
11
Multiple Views within subfolders
Hi, I am creating an application in which I am allowing users to have customized views of a form. These forms do not have to be customized at this point by the user, but will for now be customized by us, and uploaded to the server. My idea was to take the similar approach done by the plug in acts_as_attachment, and, have a default layout stored in the normal views/controller_name folder, but
2005 Dec 06
9
script.aculo.us AutoComplete Woes
I was wondering if someone could help me with an autocomplete problem. I have the autocomplete div receiving a <UL> that looks like: <ul> <li>Name<br>Email</li> </ul> When the user hits enter and the value is filled into the text field it''s putting both the name and email in the field. I just want the name. Funny this works in Firefox but not IE. I