search for: button_to_funct

Displaying 16 results from an estimated 16 matches for "button_to_funct".

2010 Oct 20
2
How do i use button_to_function
Hii all , I am trying to create a button that, when clicked on, calls a method in a controller . I am thinking that button_to_function is good to use for that i made htnl viwe like <h1>File Upload</h1> <p><label for="upload_file">Select File</label> : <%= file_field ''upload'', ''datafile'' %></p> <%= button_to_function "UploadFile&qu...
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 Contact'' do |page| page[:showcontact].replace_html :partial => ''/co...
2007 Dec 04
2
button_to_function question
Hey everybody, I am trying to create a button that, when clicked on, calls a method in a controller then changes the image on the button without a page load. I was thinking that button_to_function might be a good contender for this but I don''t yet know how to make it talk to a controller, and on success change the image of the button. Can anyone help me out with this problem? Thanks, John --~--~---------~--~----~------------~-------~--~----~ You received this message because yo...
2010 Mar 22
7
How to reference a select_tag within a form
...t; It brought up a list of vendor-names immediately under my Vendors textbox, which worked great as far as I was concerned. Then I tried to turn it into a real drop-down: 1. I added style="display:none" to the div so that the drop-down was hidden when the page opened 2. I added <%= button_to_function("ShowList", %<page.toggle :vendor_droplist> ) %> following the text_field Hiding the drop-down worked, but the button failed to restore it. Validating the resulting HTML revealed the a div is not permitted in the scope of a form. To solve this I removed the <div> open...
2009 Apr 24
2
passing a value to a js function via button_to_function
I''ve got a table of what I call resources, want to show in a jQuery dialog a particular record when user clicks button in a row. in the table I''m doing: <td><%=button_to_function ''Show'',''showresource1()'',:class =>"ui-button ui-state-default ui-corner-all", :id => resource.id %></td> js: <script type="text/javascript" charset="utf-8"> function showresource1() { jQuery("#r...
2007 May 19
4
button_to_function with image?
Hi: does button_to_function allow the use of an image? I tried it in place of the text with "image_tag" and it doesn''t work. Maybe some form of button_to? Any direction you can give would be great! Mike -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~...
2006 Aug 14
2
Change Button Text - Ajax
Hi, I have the following code <%= button_to_function "Hide", "Element.toggle(''mytext'');"%> which does toggle the invisiblity of the text just fine, But want I want via ajax magic, is to also toggle the button text, so it will now display "Show" when I have toggled the invisiblity of the Div. T...
2013 Oct 27
5
run simple method from Helper on button click
...on button click. ------------------------------------------------------------------ module PagesHelper def show_message "simple output" end end ------------------------------------------------------------------ this doesnt work <%= button_to_function "Print", "show_message()" %> this doesnt work too <input onclick=" show_message() " type="button" value="PRINT" /> Can someone please show to properly solve this problem? I would really apreciate it! thank you! -- Posted via ht...
2006 Jul 13
5
Does Javascript let you default input params like Ruby does?
Can you have a Javascript function with a param that''s defaulted if it isn''t present? function X(a, b = false, c = ''dog'') { } X(5) calls X with a=5, b=false, c=''dog'' X(4, true) calls X with a=4, b=true, c=''dog'' X(3, true, ''cat'') calls X with a=3, b=true, c=''cat'' ? -- Posted via
2009 May 05
4
modalbox rails var interpolation
Howdy everyone. I am using modalbox which is very nice an easy to use. I have this for an edit for a company listing: <td><%= link_to(''Manage Companies'', {}, :onclick => ''Modalbox.show(\''/ companies/edit/#{company.id}\'', {width: 600}); return false;'') %></td> The link is not putting the company.id in it puts #{
2006 Jul 21
10
Using an image button for "link_to_remote"
All, I want to do an AJAX request using a custom image button. I currently have this as a standard button action using "button_to". What I need is the button equivalent of "link_to_remote". Is there a helper that I can use, or do I need to build it by hand? I see button_to_function(), but that sets me up to call a Javascript function, not post to a Rails action. Or can I just do a link_to_remote and force it to be a POST? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Apr 29
11
Multiple actions from one form - possible?
Hello * Obviously the rhtml below does not work, but it should be apparent what I try to achieve - I would like to give the user the choice to submit a form either to action1 or action2 but I cannot figure out how?! It would be great if someone could give some assistance. Thanks a lot, Alex <%= start_form_tag :action1 => ''save'', :action2 =>
2006 Apr 19
2
How to use multiple buttons on the same form with AJAX?
Hi, We are trying to use multiple submit buttons in the same form to tie to different actions on the server side. For example: <input name="commit" type="submit" value="edit"> <input name="commit" type="submit" value="cancel"> <input name="commit" type="submit" value="test
2008 Apr 30
5
Quick Submit Button Question...
Hello, Can I pass a variable from a submit button only? I have a form that the user fills out and I need two different submit buttons - one for ''sync'' and one for ''full push''. I was thinking I could add some sort of param to the button, but it''s not working... is there a way to do this? I have this: <%= submit_tag ''push to
2006 Jul 20
5
Need HELP changing link_to_remote to a button
I would really appreciate some help with changing a link_to_remote call to a button of some sort. Here''s a little background. On the page there are two <div>s. One is a form that lets the visitor enter items. The second <div> is where the entered items get displayed, each in it''s own item <div>. Each item <div> has two <span>s. The first one
2007 Mar 23
11
Is there such a thing as button_to_remote?
I''ve changed my destructive link_to statements in favor of button_to. But what if I want to make an .rjs call with that button? Seems like we need something equivalent to link_to_remote, so that the button can make an ajax request instead submitting the form. Or am I missing the point entirely? Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message