similar to: Focus on ajax newly-created form element

Displaying 20 results from an estimated 1000 matches similar to: "Focus on ajax newly-created form element"

2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in ActionView::Helpers::TagHelper to do some generalized error handling similar to the way scaffolding puts a red border around fields that fail validation. I''ve created a file lib/rails_patches/tag_helper.rb which contains the following. module ActionView module Helpers module TagHelper alias_method :orig_tag, :tag
2006 Jul 18
2
A quick question on forms
I want to change parts of this form in order to use default values (with a disabled input). The problem is if I change it from text_field to text_field_tag that part of the form stops functioning. It seems like a silly question, but its been driving me crazy. Any help would help. Steve. <%= error_messages_for ''post'' %> <!--[form:post]--> <p><label
2005 Oct 24
3
Unable to use forms after login generator
I''m using rails 1.8 and login generator 1.1. I''m using rails to manage the contents of my website. I decided to put an admin page for the content management. For the sake of convenience, I used Login Generator. Now when I go to edit or create new content (for now, just posts), it gives me the following error (this one is for new posts): NoMethodError in Goblin#new Showing
2010 Nov 08
1
API Google MAPS
Hello everybody, I''m working with Version 3 of Google Maps JavaScript API, and I have the next code: In a layout of my application: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/ libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?
2006 Jan 06
3
image replacement (new Effect.*****) problem
Here''s what I''m trying to do. I have two divs, one holds about 20 small images of products and the other holds a single large image of one of the products. I''m trying to use the jazzy "new Effect." way of changing images but I can''t seem to get it too work. My script is replacing the image and then making the element disappear. What
2006 Apr 12
11
innerHTML and scripts not running
Hello, I''m having an issue with getting embedded javascript code to actually run when loaded via an Ajax.Request() call and the callback function inserts the generated HTML and js code to my current page. It seems that the javascript code is not properly parsing. For example, I''m using the following function showinfo() to return some html code. function showInfo(go_url){
2010 Jan 20
5
disable submit_tag after click
This code disables the ''Save'' button once clicked, but doesn''t seem to send the form data. <%= submit_tag ''Save'', :class => ''submit'', :onclick => "document.getElementById(''save_button'').disabled=true;", :id => "save_button" %> This code sends the form data and a record is created,
2008 Mar 27
3
Help with authentication errors
Hello, I have been working through two books, "Agile Web Development with Rails, 2nd Ed." and "Ajax on Rails". I''m using Rails2.0. In both cases, I run into an authentication error when doing the examples. In AWDwR, when trying to add new information to the database (p. 68) I get ActionController::InvalidAuthenticityToken in AdminController#create
2009 Jul 24
6
Routes from raw js (using XMLHttpRequest)
I am making an ajax call from js to call a method (assocboxchange) in my controller (AssociatesController), using XMLHttpRequest. I know the XMLHttpRequest works fine because I use it in other places with success. My problem is my URL I am using for this request doesn;t access the method in my controller which I (think) I am specifying. I am having it post to /channels/assocboxchange/" with
2008 Dec 13
2
What is "The Rails Way" to do this?
I have a PHP application with the following in one of the "views": <input type="button" onClick="newAlt()" value=" + "></nobr> The JavaScript for "newAlt()" is: // using DOM create new input box for alternate part function newAlt() { var html = "<input style=''background-color:#FFFFCC'' "; html +=
2009 May 07
12
is there simpler way to export html within xml
Hi, we''re exporting a lot of html code within xml, our current method works but it''s very messy - far from perfect, is there a better way to do this. an example of our controller code is html = html + "&lt;img src=&quot;/icon/icon_email.gif&quot;
2009 Feb 26
8
beginners question
hi group, I am making a little rails app to experiment with rails. It consists of one model, item, that represents an item on a todo list. A todo item has a description, a state (finished or not) and a due date. After changing the scaffold screens a bit, I wanted to be able to have no due date. I tried to do this by making a radio button; if ''no date'' is selected, the date
2010 May 05
6
form remote tag :before=> function problem
Hi I have a strange problem, I am using the below code form_remote_tag :url => ''/abc/test'',:before => "return hello();", :update=>''test_categories'' ,:complete => "Element.hide(''spinner'')", :loading => "Element.show(''spinner'')" do I am using :before=> function to validate the
2008 Feb 13
8
comparing ajax.updater div in js
This is really bugging me no matter what I''m trying. In javascript, I''m using the ajax.updater, and it (obviously) writes back out to a div. I want to then compare what was echoed out into this div (which came from the php file I listed in ajax.updater) with a string. test should equal "SomeString" because that is what is being echoed out to
2006 Mar 15
2
Using form_remote_tag, setting the form name
I''m using form_remote_tag like this: <%= form_remote_tag \ :update => "div_id_dataentry_bottom_ajax", :loading => "document.getElementById(''wait'').innerHTML=''Loading...'';", :url => { :action => "dataentry_bottom_edit" } %> And it makes this code: <form
2006 Jul 06
2
link_to_remote method display a loading image?
Hey guys, what would be the best way to incorporate this into the builtin link_to_remote() method? document.getElementById(''main'').innerHTML = ''<img src="/images/loading_small.gif">''; Id like for the item above to take place while the page is loading. I''m currently doing this with another javascript but would prefer to use rails.
2007 May 05
2
Problem with escape
Hello, I have a little problem with the escape function. Here is my code: function saveData() { new Ajax.Request("post.php", {method:"post", parameters:''message=''+escape(document.getElementById("shoutitmessage").value) } ); } If I have the escape function in my script I can''t post some characters e.g. ä,ö,ü,ß but if
2006 Jul 10
17
Effect.SlideDown/Up() and HTML issues
Hello, I''m hoping this is the right place to ask these kind of questions. If not, please excuse me. Anyway, the problem I''m having is that I have a HTML table showing some tabular data and I want to use Effect.SlideDown/Up to allow the user to interactively show "details" for each item (<tr><td> etc) in that list. I''ll do some pseudo-code for
2007 Aug 25
2
insert HTML <select> value into a textarea - Works in IE6, not in FireFox or Opera
I have a simple form at http://mstramba.com/fb5.html It''s just a <select> and a textarea. The idea is to be able to either type into a text area directly or choose from a list of saved words in the select box. When a new choice is made from the select, it automatically gets inserted into the text area. This code DOES work in I.E6 (on my machine (XP pro), but doesn''t
2006 Feb 07
1
Help needed with conflicting EventObserver
Hello everyone, I have a page that populates/updates make, model and year select lists via Ajax.Updater and I think that an EventObserver is causing a conflict. Here''s what I''m trying to do. I''m using this page as a create and edit page for a car database. If I''m calling the page in edit mode, I''ll want the make, model and year set (using the