similar to: Parse selectbox value with javascript

Displaying 20 results from an estimated 30000 matches similar to: "Parse selectbox value with javascript"

2006 Aug 08
2
Javascript - multiple select selectboxes
I am trying to populate a multiple select box using javascript, but am having problems with the name. When I change the name to "codes[]" I can''t get the javascript to find the form element, but without the [] on the end, rails wont read all of the selected values. Here is an example of the javascript working, but when you submit the array is not passed across for the codes.
2011 Aug 18
9
RJS error rails 1.2.3 + firefox 4 and above
Hi, In my application I used in admin module to expand and collpase functionality using ajax(link_to_remote) method. It''s working fine in mozilla 3 and below version.. But when I using in mozilla 4 expand functinality was working fine but collapse are not work, it''s just ''wrinkls''. My code is like below <tr id="<%= content_element_id
2013 May 31
11
A simple javascript alert not working
If I have a file in view /test called index.js.erb and in it a simple alert("hello") shouldn''t that run when I go to /test/index? It doesn''t. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it,
2010 May 03
7
rendering images dynamically
Hi, I have a rails application where I respond to a request by fetching image urls from various web api calls and need to display them as they come available. I am able to display all the images once I get them all, but that causes an unacceptable delay for my user. One approach I am trying is, from my controller, set an @image variable, and then pass in a block to the model that retrieves the
2010 May 28
8
form helpers don't seem to work with RJS files...
I’ve been spending a great deal of time chasing this problem. Hopefully someone sees something obvious I’m doing wrong. Basically anytime I try to call fields_for from an RJS file or within a partial in the RJS file, I get the following error. My goal is simply to load a partial into a div. The fields in this partial require fields_for though. And that’s where the problem lies.
2011 Aug 13
3
How to make an AJAX call to different domains in Ruby on Rails 3.0
I have an action email in my controller of application running on www.example.com and I am trying to send the form data of email to www.data.example.com/email where my another application receives the request and I am able to save the data in js format. But I want to send back the acknowledgement to www.example.com and replace the html using rjs template. Here are some code for you reference:
2011 Feb 15
7
Hide/Show Div and link_to_remote
Hi I want to show some info and provided an ''edit'' button next to it. This will change the display info to an editable form. I''ve seen this done before, but what I can''t figure out is whether I have to use an actual remote action to the rails server? I think I should be able to render both the edit box and the display info as seperate divs, and then show/hide
2011 Jan 15
3
respond_with javascript
My ajax stopped working when I switched to using respond_with. For my Votes, I have the create action and the corresponding create.js.erb, and respond_to :html, :js, :xml in the controller. Heres the log when I try and create a vote: Started POST "/stories/3-asdfasdf1111/votes" for 127.0.0.1 at Fri Jan 14 20:46:36 -0800 2011 Processing by VotesController#create as */* Parameters:
2010 Mar 22
7
How to reference a select_tag within a form
Hi All, Inside my app\views\expenses\new.html.erb file, I had the code: <% form_for(@expense) do |f| %> [snip] <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <br /> <div id="vendor_droplist> <%= select_tag "test", options_for_select(@current_vendors.collect { |v| v.nickname }), {:multiple
2011 Jul 27
20
Rails, jquery and Ajax
How do I make an ajax call and then update a div with a partial? I''ve tried this but it''s not working. Comment is created but the partial is not loaded. //view <a href="#" id="testlink">Testlink</a> <div id="commentlist"> </div> //controller def new @comment = Comment.new @comment.save
2011 Mar 14
1
Javascript & Rails future
Hi, David H.H. announced recently that jquery is going to be the default in Rails 3.1, and that Prototype helpers / RJS are going into a gem. What does that mean for the future? Should we progressively forget about things like javascript helpers, RJS, and all these fun parts of rails? And start coding with jquery/json in mind? I''m not against that at all, but I have to admit I find RJS
2010 Feb 25
10
ajax.updater problem
Hi everyone I´know that it is not a ajax forum, but Im using ajax ina program created with rails code and I think that I´m not the unique person who use the Ajax. UpdaterPeriodically. My problem is that my program doesn´t refresh the div tag, following it´s my source code. Anyone can say me why it doesn´t work? <head> <%= javascript_include_tag ''prototype'' %>
2010 Jul 27
7
trouble with remote_form_for & html_update
I have a form that accepts comments and adds them to a list without refreshing the page. This is the html: <div id=''aremark''> <%= render :partial => ''comment'' %> </div> <% remote_form_for :comment, :url=>story_comments_path(@story), :html => { :id => ''comment'' } do |form| %> <h5><label
2010 May 24
2
Two RJS visual effects will happen at the same time?
I was going to change the background of a div from white to red and then from red back to white, so this is used in an RJS file: page[:vote_score].visual_effect :highlight, :startcolor => ''#ffffff'', :endcolor => ''#ffcccc'' page[:vote_score].visual_effect :highlight, :startcolor => ''#ffcccc'', :endcolor =>
2010 Dec 21
8
Rails - escape_javascript without all the \n\n\n\n\n
Hello, I''m using escape_javascript to return a partial to the browser via ajax. Something like: $("#inject").html("<%=escape_javascript(render :partial =>"feed/ index")%>"); Problem is escape_javascript ends up outputing all kinds of wasted space like \n\n\n\n\n \n Is there anyway in Rails to escape_javascript more
2012 Oct 12
3
CheckBox with Value and Drop down menu
I am a newbie in Ruby. I would to ask from all the experts in Ruby on how to create a checkbox with value as well as a dropdown menu. I want it like this site http://www.celiac.com/glutenfreemall/advanced_search.php. Their search form is good and I want to learn every aspect in doing it. Hope you can give me a step-by-step tutorial in doing it. Thanks in advance. -- Posted via
2010 Mar 16
4
Get content from HTML element in Rails
Hey, I''m looking for a way to get the content of my div in my Rails view. I would like the literal HTML content, so only HTML and no Rails I thought inner_html would work, but I get a RJS exception (TypeError: $("content").innerHtml is not a function) Does anyone know how I can get the content? Thanks! In my controller I use this code: [code] def save_test render :update
2010 Jul 01
6
Close Modalpopup with RJS
hi guys: I''m scratching my head on this one: I have a twitter app where I''m trying to open a modalpopup with a twitter sign in, get them to sign in, then close the popup and refresh the main window. My code however refreshes the main window with the popup window result, which I thought was really strange: application.html.erb function OpenModalPopUP() {
2006 Jul 04
1
Select Box problem in the controler with Ajax
Hi, I have a selectbox that updates a given span area when a user selects a value. The selectbox has the option :include_blank => true. The controler will fetch the ID of the selected option in the combo box and sends the description of the item with the same ID. The problem is that the user is able to select the empty option, and the controler will not be able to fecth the ID. This
2011 Sep 14
5
rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
hi, i am using rails 3.0.10 i am trying with sample application for searching data from table and updating my search.html.erb file is <%= form_for (@employee) do |s|% <div id ="search_details"> <%= s.text_field :name%> <%= s.text_field :emp_id, :onfocus => ''sal(document.getElementById(''employee_name'').value);''%>