search for: javascript_tag

Displaying 20 results from an estimated 40 matches for "javascript_tag".

2007 Jun 19
1
javascript_tag replacing whitespaces w/ '%20'
javascript_tag replacing whitespaces w/ ''%20'' Hello, I have a form that tests if a title has been changed since the page was loaded and the page has been submitted. If the page title has been changed then a confirm box will ask if the user wants to have the title changed. The problem is...
2005 Dec 24
2
Ajax Help: Multiple Updates - ?
.../div> <br> <div id="detail2"> </div> <br> <div id="detail3"> </div> <br> <div id="detail4"> </div> # controller def updateDivs render(:layout => false) end # updateDivs.rhtml <%= javascript_tag( update_element_function( "detail1", :position => :top, :content => "testData1" ) + update_element_function( "detail2", :position => :top, :content => "testData2" ) + update_element_function( "detail3", :posi...
2006 Mar 13
2
Keypress events with no AJAX needed
...ll of the "helpers" involve server (controller) communication. For example, having a text field that just echos below what the user types. Is this the only way to do it? <div id=''word_panel''> <%= text_field_tag ''user_text''%> <%= javascript_tag("Event.observe(''user_text'', ''keypress'', function(event) { Element.update(''stylized_word'', $F(Event.element(event)));})")%> <div id=''show_word''></div> Thank you! Chris -- Posted via...
2006 Jun 15
3
how to give a form a name
Using a <%= form_tag ... %>, how do I give a form a name, so that I can reference it with javascript? I sure can''t figure this out from the docs... Thanks, Shelby PS - what I am trying to do is just have the focus in the first form field when the form is loaded. There has to be an easy way to do this, but I can''t figure it out... -------------- next part --------------
2007 May 14
8
Problem with script.aculos.us script
..., controls.js and slider.js and prototype.js into my app/public/javascripts/ 3. Then included the <%= javascript_include_tag :defaults %> code into head section of my view file. 4. Then executed the code <div id="dragDIV" class="green box">drag</div> <%= javascript_tag "new Draggable(''dragDIV'')" %> <div id="helperDIV" class="green box">helper</div> <%= draggable_element :helperDIV %> But now I can''t drag it. Whats the wrong I did. Can anyone suggest me. Or is there any code to check...
2006 Mar 22
1
Lightning Fast Javascript Auto complete
<%= javascript_tag("new AutoCompleter.Local(''search_start_station'',''start_station_auto_complete'', stations);") %> I have <%= javascript_include_tag :defaults %> in the head of my layout. But I always get an Error: "AutoCompleter is not defined"....
2007 Sep 05
0
Savage Beast plugin: Question on the reply form
...ag _("Save Reply") %><span class="button_or">or <%= link_to_function _(''cancel''), "$(''reply'').hide()" %></span> </td> </tr> </table> <% end -%> </div> </div> <%= javascript_tag "$(''reply'').hide();"%> <% end %> <% end %> I would think <%= javascript_tag "$(''reply'').hide();"%> would hide the reply form after the Save or Cancel action. Does anyone have any ideas? I want the reply form to be hidd...
2006 Feb 03
2
JavaScript Prototype Help?
...t;, options) javascript = "new Form.Element.Observer(''#{field_id}'', " javascript << "#{options[:frequency]}, " javascript << "function(element, value) {" javascript << "#{callback}}" javascript << ")" javascript_tag(javascript) end This does half the job: it updates the div while the user types, but instead of evaluating the JavaScript in options[:content] it''s outputting the string I want evaluated. I need a way to evaluate the JavaScript in options[:content]. I''m 99% sure my answer...
2006 Apr 26
3
Setting focus in a rhtml view
How do I set focus on a specific form field when I render a partial from the controller? I can do it with page[''name''].focus from an RJS view, but I can''t figure out how to do it when rendering this rhtml partial from the controller. I''m rendering a partial with two fields and neither one has focus until I hit the tab key or put the cursor in a field with the
2010 Jan 18
7
Ruby Array to Java Script Array
Hi, How can we use an array created in Ruby in Java script ? Regards, Prashant -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2006 Mar 31
5
RoR 1.1 RJS problem
...ntroller code class AbeProto1Controller < ApplicationController def index end def show_conf_admin end def conf_admin render( :partial => "conf_net") end end ******************************************************************************* The index.rhtml: <%= javascript_tag("document.getElementById(''index'').className=''selected'';") %> <div id="main_title"> <%= $PROJECT_NAME %> Configuration Wizard </div> <!-- main_title --> <div id="main_description"> T...
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 May 02
5
How to call a javascript function from rails view?
Is there a way to call a javascript function from within a rails view? I can''t use the onLoad javascript method inside the <body> tag because I don''t have control over the body tag, it''s in my header. There are several rss feed reading functions that are in the page and I would like to call those functions while the page is being loaded or once it''s
2006 Jul 28
1
How to ajax highlight a flash
Hi, I want to make a flash[] highlighted for let''s say 5 seconds when some action is invoked. In the controller, I have: flash[:notice] = "error" In the layout, I have: <p style="color: white"><%= flash[:notice] %></p> I don''t know how to use ajax with the flash. I tried something like: element.highlight(flash[:notice]) without any
2006 Jun 09
1
Positioning cursor to first form field
whenever I display the form to the users now the user has to click on the first field; how do I make it automatically positioning on the first user enterable form element (is there any javascript helpers) thanks -- Posted via http://www.ruby-forum.com/.
2006 May 16
0
in_place_editor with local autocomplete
...lete div --> <div class="auto_complete" id="style_auto_complete"></div> <%= in_place_editor( "style_lookup", { :url => url_for( :controller => "styles", :action => "style_jdetails" ), :script => true } ) %> <%= javascript_tag("new Autocompleter.Local( ''style_lookup'' , ''style_auto_complete'', styleArray, { fullSearch: true, frequency: 0, minChars: 1 });") %> The problem here is that in_place_editor creates an input tag with no id, so the Autocompleter can not find it....
2006 Apr 05
1
New AJAX function: remote_replace_with_partial() <-- write less code
...;, ''# {param_string}'');") string end application.rb file: def partial_handler string = render_to_string :partial => params[:partial] render :inline => string end javascript code: (this can be placed in a JS file or in your template) <%= javascript_tag "function update_page_element(element_id, controller ,partial_file, params) { new Ajax.Updater(element_id, ''/'' + controller + ''/partial_handler? partial='' + partial_file + params, {asynchronous:true, evalScripts:true}); return false; } " %> Vi...
2006 Apr 09
1
RJS across iframes
I have an inline iframe which has a form in it, when the form is updated, I would like to call an RJS template that will update the parent page. +-----------------------------------------------+ | | | <div id="mydiv"> Update with RJS </div> | | | |
2006 Mar 09
0
Get width of an element using javascript
...''s in the prototype library called getDemensions. I''m just not sure how to perform the call. document.GetElementById(id).offsetWidth works fine with and onClick event, but I need to get the width value at various time during the page load. I also tried the remote_function and javascript_tag methods, to no avail. How do I call javascript without an event in rails? Any suggessions? -- Posted via http://www.ruby-forum.com/.
2006 Mar 11
2
Customising FCKeditor
I would like to customise my FCKeditor-instance so that when the "add image" button is pressed, it opens my own add_image popup. In this popup i would handle the image upload/image browser/etc. tasks with rails. How can I open the popup and pass the picture information from there back to FCKeditor''s textarea? -- Posted via http://www.ruby-forum.com/.