similar to: Update multiple fields with onclick

Displaying 20 results from an estimated 12000 matches similar to: "Update multiple fields with onclick"

2008 Feb 19
1
adding an onclick option to link_to method
Hello, I''m trying to use the rail link_to to open a popup window and then print the popup window at the same time. Is there a way to add another "onclick" option to tell the popup to print? I know how to do this in javascript but not sure how to use the rails help to do it. I also am aware that the link_to_function method is used to call a javascript function.
2009 Aug 07
2
calling a jQuery function from RJS/onclick
Hi, I have the following jQuery function on the head of my page. <script type="text/javascript"> jQuery.noConflict(); /* calling jNice on document ready */ jQuery(document).ready(function($) { $(''div.jNice'').jNice(); }); ..... </script> On page load, this gets called correctly. Now there''s a link on the page that lets me add more
2007 Jun 26
3
what is the :or parameter in a submit_tag ?
I read the following tag in teh Beast example <%= submit_tag''Login'', :or => link_to_function(''forgotten password'', "$(''reset-password'').toggle();") %> I understand the link_to_function, but what is this :or parameter used for ? the link doesn''t appear, so it cannot be used... thanks for your lights kad --
2010 Apr 12
3
$(link).previous("input[type=hidden]") is undefined
I am getting this error when trying to use the remove link explained in the Railscast: http://railscasts.com/episodes/197-nested-model-form-part-2 error: $(link).previous("input[type=hidden]") is undefined remove_fields()applic...1065175 (line 6) function onclick(event) { remove_fields(this); return false; }()1 (line 2) [Break on this error]
2006 Aug 08
1
link_to_function
Hello I wonder why this happens: this: <%= link_to_function image_tag("chart_bar.png"), :onclick=>"new Effect.toggle(''bar-project#{project.id}'')" %> outputs this: a href="#" onclick="onclicknew Effect.toggle(''bar-project188''); return false;"><img alt="Chart_bar"
2010 Feb 06
2
observe_field example of two related selects
I''ve done the ''Googling'' for days now to find an example of using two dependent select statements on a form where the user selects the parent record value and the observe_field ''kicks in'' to create another select that shows parent.children offerings. Is there anyone I can pay to provide me with the simplest example? If so, please contact me by email.
2009 Sep 24
4
Action Controller ::MethodNotAllowed
Hi, Iam getting the following error ActionController::MethodNotAllowed Only get, put and delete requests are allowed. Actually, Iam trying to have multiple actions for a form to create new record. The actions for the form are cancel, save, publish and preview. here''s the config/routes.rb file code snippet for the relevant controller - Events map.resources :events, :member =>
2006 Aug 04
3
<img onclick> vs link_to_remote()
In one of my view , I have an image the user need to click to close a <div>selections</div> added by an Ajax call. if I use : <img src ="/images/icon_closeitem.gif", size="16*16", border="0",alt="Close Selection", title="Close", onclick="<%= remote_function(:url => { :controller => ''property'',
2006 Mar 18
2
Additional link tag attributes with link_to_function...
Hi, I''m having a bit of a struggle with link_to_remote. Everything works exactly as I want it, but the problem is that I want to add another attribute to the <a>-tag, namely class="". Long story short, I want specific links to look differently from others, but all of them being link_to_function. Normally, I''d do this with adding a class="foo" to
2006 May 13
2
Using RJS in views without ajax
Hi! I can use RJS in views like this (without using ajax): <%=link_to_function("switch fields", update_page do |page| page.insert_html :before, ''date'', date_select(''exhibition'', ''date'') page.remove ''date'' end) %> Is there a way to move this RJS code into a function to separate file? .js files are not parsed
2008 Feb 13
2
javascript pop window from form how to update field back to main form
Hi I have question where I run web form. Now on this form I have one field with link select user. This link will pop up new window with javascript and on this window I have form with items which end user can select. Once selection is done end user press button Select User. Now I need to close that javascipt window and send back value of that selection back to form and to the field which has
2006 Apr 21
4
link_to_function with submit
I looked everywhere but couldn''t find it. I don''t want a submit_tag or image_submit_tag but a normal link that submits my form. Normally I would do this with a javascript like function sendForm () { document.forms[0].submit(); } but this doesn''t work with form_remote_tag link_to_function( ''Send'' , "sendform();") So the question is:
2009 Dec 06
3
link_to_function or button_to_function memory usage
I have an full ajax app doing crud operations for contact info for one section. I was using ajax calls to edit and cancel and also to add a contact. I am implementing a button_to_function instead of doing an ajax call to just edit/add/or cancel a contact. I am running into a memory issue using the button_to_function or link_to_function. I have this: <%= link_to_function ''Edit
2006 Jun 27
4
RJS Form Values
Hi, I have the following code : <%=link_to_function("? | China", update_page{|page| page[''tags_en''].value = "China" page[''tags_ch''].value = "?" }) %> This updates two text fields with the China and ?. However I want to append the values, not replace them. So I need something like this :
2011 Nov 04
1
add dynamic nested attributes without nested form gem
Hello people In my rails 3.0.9 app I''m trying to add nested attributes dynamically, but I don''t want to use "nested form gem" So I found this example https://github.com/alloy/complex-form-examples/blob/a234fde4419836f277d7e340657f1d8418911d68/app/helpers/projects_helper.rb but this code doesn''t work module ProjectsHelper def
2006 Mar 02
4
Instance variables in Javascript param
How can I make this work ? <a href="#" onclick="new Effect.Fade(@div_id)"></a> @div_id is an instance variable ? TIA -- Posted via http://www.ruby-forum.com/.
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute? <div id="new_item_details" style="display:none"></div> <%= link_to_function("Show details...", nil, :id => "show_details") do |page| page.visual_effect(:toggle_blind, :new_item_details) if (page[:new_item_details].style.visibility ==
2006 Aug 18
3
RJS templates for DOM manipulation
I want to do some DOM manipulation with JavaScript. Specifically I want to implement zoom in/out in a picture by changing it''s width/height attributes. Is it possible to do this using RJS or should I write javascript by hand? All the examples of RJS I''ve seen write the javascript in the result of an AJAX remote call. Where are the docs for RJS? All I''ve seen are blog
2008 Jun 18
7
Object Task at episode 74 of railscasts
Hi. In the episode 74 <http://railscasts.com/episodes/74>, Ryan has a model "project" that can have many "tasks", and he uses link_to_function to dynamically add a field in the form for a new Task. In order to do that he created a helper called add_task_link. The code of the method is: # projects_helper.rb def add_task_link(name) link_to_function name do |page|
2007 Dec 20
3
How-to spec this helper method?...
Hey gang, I have this dead-simple method defined in a helper: def add_category_link(name) link_to_function name do |page| page.insert_html :bottom, :categories, :partial => ''category'', :object => Category.new end end Where, and mostly how, would I spec this? I haven''t been able to find how to stub the rjs in a helper spec, so