similar to: Insert text into text area field with RJS

Displaying 20 results from an estimated 6000 matches similar to: "Insert text into text area field with RJS"

2006 May 28
1
RJS template / page.insert_html problem
Hiall, I have a rjs template which is calling page[:xxx].replace_html ... a couple of times and this works perfectly. However, in the same rjs file I have two calls to page.insert_html, which do not work. No error in development.log, nor error message in browser, the new content for the div simply isn''t changed at all. This is my code: ... action = "save_" +
2006 Apr 05
2
RJS and remote forms
I''ve run into what I think is a browser bug related to using remote_forms pushed in an RJS update. In my controller, I have an action that creates a new model and returns a form for one of its children: def create_party party = Party.create render :update do |page| page.insert_html :top, ''party-list'', :partial => ''party_header'',
2008 Sep 22
3
syntax error in RJS
I''m new to Ruby on Rails and came across a problem I could not solve alone. I''ve a pretty simple RJS file that looks like the following: 3.times do page.insert_html :bottom, ''messages'', ''test'' end page.call ''updateMessageWindow'' However this snippet gives a syntax error: ActionView::TemplateError (compile error D:/Eigene
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a list of projects: page.replace_html ''results'', ''<div>'' @projects.each do |p| page.insert_html :bottom, ''results'', p.name + "<br/>" end page.insert_html :bottom, ''searchresults'', ''</div>'' page.show
2006 Jun 21
2
Using RJS to highlight one LI if using insert_html on an UL?
It seems common to use RJS for quickly adding and highlighting a list that is having content added to it like this: http://rafb.net/paste/results/Z3m32g48.html ... where "my_list" would be an UL and the partial would insert a LI. Given that example, is there an easy way to highlight only the newly inserted LI instead of the whole UL? The only way I can see to do it is to give
2013 Feb 05
3
Truncate text
Hi Folks, Good evening, I used the code which i print below, Yes i got the result , but i need the result like this "TruncateHtml is jus....(continued)" some_html = ''<ul><li><a href="http://whatever">TruncateHtml is just like the vanilla truncate rails helper , TruncateHtml is just like the vanilla truncate rails
2006 Jul 03
6
Rjs $("aaa").insertHtml is not a function error
Hi, I''ve searched the list and found that someone had the same problem as me http://lists.rubyonrails.org/pipermail/rails/2006-May/043760.html I''m have in my page a link like this <%= link_to_remote ("Add #{image_tag(''add.png'')}",:url=>{:action=>''addProduct''})%> and in my controller def addProduct ..................
2006 Aug 02
9
RJS not cross browser compatible?
I have an RJS template that does the following page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' This works just find in safari and firefox. In IE and Opera it doesn''t work so great. Any ideas? Am I doing something wrong here? -- Posted via http://www.ruby-forum.com/.
2006 Nov 18
2
RJS page.delay timing issues
Hi. Has anyone ran into issues with the timing of page.delay. I have been testing in firefox, for the most part, and it seems that there is no reliability on when the page.delay timings kick in. What happens is that sometimes it will work fine, and the countdown looks great; other times it will just jump to the end and display everything at once, other times it will be jerky. I''m on a
2006 May 08
3
Can you apply effects to elements create in same RJS file?
I am trying to create a new element in a list and highlight it. I am doing the following in my rjs file: page.insert_html :after, ''bananalist_header'', :partial => ''banana'' page.visual_effect :highlight, "banana#{banana.id}", :duration => 1 The first line creates a new element with the id= ''banana3'' say... The second line then
2006 Jul 19
3
render :partial inserting new line in RJS
Struggling a bit with rendering a partial in an RJS template. I''m having to feed the javascript directly to the page object as couldn''t find a way to have insert_html work directly on the proxy object returned by select. However, that''s not the problem. The code for doing that is below and it all works fine, except that a new line is being inserted after the
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. Thanks for any help. John -- Posted via
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
2006 Apr 09
4
Best RJS process for what I''m trying to do...
I just wanted to ping this off the list to get some advice since I''m now pulling my hair out. Thanks in advance for taking any time to look at this. It''s much appreciated. Now, my problem is my RJS is working but it''s not inserting how I want it to insert. I have a partial I''m rendering in my view that looks like this: <ul
2006 Jun 27
5
RJS -- What am I missing?
This is driving me nuts:-) I''ve brought it down to a simplified case where I''m rendering this rjs template: page.insert_html :top, ''cat1'', "<li>Some list item</li>" According to FireBug, this is what I''m actually getting in the browser: try { new Insertion.Top("cat1", "<li>Some list
2006 Mar 03
1
rjs isn''t update_page problems
i have a list of, for example, meal_names. Basically, I can submit a name and the name I add shows up in the list.I had this working wehn i created an actual add.rjs template for it. So feeling good about my self, I attempted to move it all to the controller and use some update_page goodness. Now it the ajax middle doesn''t happen. I don''t get any errors but the list
2006 Jun 08
3
RJS wierdness - Content div display js code
Hi, I have a link_to_remote name ''Show notes'', which calls an action that uses this RJS template: page.replace "notes_remote", :partial => "notes/hide_notes_link" page.insert_html :top, "notes_list", :template => "notes/list" page.visual_effect :highlight, ''notes_list'', :duration => 3 Works great. The
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 Jul 21
1
RJS Failing
This code was working before I created the update_link_list method in the helper below (everything was in the controller). I can successfully create a new link but I get a TypeError when I leave all form fields blank -- I expect to see validation error messages. --- #link_controller.rb: def create link = Link.new(params[:link]) saved = link.save num_links = Link.find(:all).size
2006 Apr 01
2
Inline RJS in controller
Inline RJS and Controller Hi guys, I really like the idea about inline RJS. I have about 20 rjs files for this 1 controller. They are small. Just updating and hiding some div''s. So to move this into my controller would clean up a lot. It makes sense because you see in the controller what you do. Question: 1. Any penalties for doing this? - size of controller increases - performance