Displaying 20 results from an estimated 3000 matches similar to: "Submitting an ajax form via a select"
2010 Aug 14
1
Rail3: UJS submit after client-side validation
I am have some problems with UJS. I have a (potentially) large form
that I was doing client side validation on (yes there is also some
server side validation) using an old prototype validation routine that
is not working with the current version.
I actually got validation to work by coping and modifying some of the
rail.js routine to observer submit. I also had some javascript toggles
that I got
2007 Dec 15
3
List Box Issue - Should be easy, but nor for me!
I have the following snippet in my app:
<% @anitem = Item.find(:all, :conditions => "id = " + params[:id]) %>
<% form_for :anitem, :url => { :action => :updateitem } do |thisform|
-%>
...
... (some code...removed)
...
<%= collection_select :thisform, :item_category,
ItemCategory.find(:all), :id, :name %><br>
<%= collection_select :thisform,
2006 Jul 26
7
syntax for specifying :html fallback on form_remote_tag
Has anyone gotten the :html option for specifying a ''fallback'' action if javascript''s not enabled working on form_remote_tag (or remote_form_for)? I can''t figure out how to specify the action that''s supposed to be invoked if js _is_ enabled.
Or maybe I''m just misunderstanding how this thing is supposed to work. I was assuming
2006 Apr 26
2
Problem with auto-submitting AJAX form
Hello,
I have a form generated with form_remote_tag that contains a selection
list. I would like to auto-submit the form when the user makes a choice
in the selection list, so I added an option :onchange =>
''this.form.submit()'' to select_tag
Now what happens is that when I make a choice, the partial template
get''s rendered as expected, but not replacing the
2006 Jul 31
4
Text field not being submitted via form_remote_tag; works via form_tag
Hi everyone,
Newbie here. I''m trying to get a textual form element to submit in
the context of a form_remote_tag block and having little success.
Oddly (or perhaps not), using regular old form_tag in its place does
cause the elements to be submitted. Here''s the relevant partial ERb
code:
<%= form_remote_tag( { :url => { :action => :out, :id => pending_task } } )
2006 Mar 29
4
using onchange options in forms
Hello,
I''m trying to get a select field to update a view via the ''onchange''
option. I''ve seen examples of it here in the forum where people hardcode
the forms and use javascript to trigger the change (and nearly all have
complained that it''s a hack) and I''m wondering if anyone has a more
elegant solution using the embedded ruby methods?
2006 Mar 08
6
Difficulty with params hash and submit_to_remote
Hi,
Is there any trick to initializing the params hash via submit_to_remote()? I
have a form with two submit methods - the regular, non-AJAX method, and the
AJAX method. The regular method works like a champ. The submit_to_remote
invokes the correct controller, but the params hash is empty except for the
values for :action and :controller.
I''d show my code, but it''s on
2006 Jul 06
7
form_remote_tag submitting to an rjs file.
I have the following form that I am trying to use, but for some reason,
the form gets submitted with out the params values.
<%= form_remote_tag(:url => { :action => :add_item_to_order }) %>
<tr>
<td>
<%=collection_select(:order_item , :item_category_id,
@item_categories, :id, :name)%>
</td>
<td>
<%= text_field
2009 Sep 02
8
select_month helper
I''m trying to rewrite a fusebox-like application (Active4D plugin to
4D database) in RoR/postgres and I''m doing okay - but keep running
into things that stump me. It seems like it takes me hours to figure
out something that I could have written in pure code in minutes.
The select_month and select_day helper has been my latest waste of
time. All I''m trying to do is add
2006 Jul 26
3
adding class or id tags to tags like linkto and form
I''m trying to figure out things like this by myself so I don''t bother my
developer and slow him down. How do I add class or id css attributes to
tags like this:
<%= form_remote_tag :url => { :action => "send_url" } %>
<%= link_to_remote "My Profile URL", :url => { :action =>
"send_profile_url", :id => @user.id } %>
2010 Oct 06
4
List of html_options available
I''ve noticed lots of people online complain about not good documentation
for Rails. I''m a PHP programmer but I''m a newbie on Rails.
I''m creating a form with a drop-down menu. I finally got to do it. I
noticed there is a html_options parameter for select. I was curious as
to what other html_options are available but couldn''t find a list of
options. I
2005 Dec 21
3
How to make a drop-down automatically submit an AJAX form
Hi,
I know that to make a dropdown box automatically submit when you change
the value, you do this:
<select ..... onchange="this.form.submit();">
BUT i''ve got an ajax form, and if i do the above trick, it simply
reloads the ajax partial into the whole screen, rather than into the div
where it is meant to go.
I''ve already got it all working so that if you click
2006 Jun 06
1
Getting value of form using Ajax (and problems with Safari)
I have got two forms, the first is a textarea plus a link that activates
some javascript to change the form, the second activates some javascript
on the onchange event which changes it into a textarea form.
This works in Firefox, but not in Safari.
Also, I need the value which is selected. I''ve found an example that
gives the parameter to the javascript, like this:
<input
2007 Dec 02
4
select and passing some javascript
Hello,
After reading and reading the documentation, I can''t append some
javascript function into a select.
It''s not possible ?
documentation:
-------------------------------------------------------------
select(object, method, choices, options = {}, html_options = {})
some code:
-------------------------------------------------------------
return select(:id, :year, [
2006 Jun 06
0
Get value from form using rjs, and problem with Safari
Hi,
I have got two forms, the first is a textarea plus a link that activates
some javascript to change the form, the second activates some javascript on
the onchange event which changes it into a textarea form.
This works in Firefox, but not in Safari.
Also, I need the value which is selected. I''ve found an example that gives
the parameter to the javascript, like this:
<input
2006 Jun 12
2
dom id on form_remote_tag
I want to make use of a form_remote_tag to submit a form
asynchronously. Easy done. However, we also want to add an
observe_form tag to check for some value changes while the form is
being entered.
The observe_form tag needs a dom id to work on but I can''t see how to
enter an html option for the dom id of the form on the
form_remote_tag.
Any ideas?
Here is the form tag so far...
2006 Jul 02
6
remote form w/ evalScripts:true
Hello. I want to select an item from a select list and have that
result in an ajax call that updates two sections on the page. Here is
the code in the controller
def create
...
render :update do |page|
page.replace_html ''list_items'', :partial => ''lists/list_items''
page.replace_html ''add_item'', :partial =>
2006 Jun 09
0
options vs. html options in collection_select
I wanting to add an onchange event handler to collection_select but I''m not
sure how.
The api gives the signature as
collection_select(object, method, collection, value_method, text_method,
options = {}, html_options = {})
I''m not sure, however, if I need to place the desired code in "options" or
"html_options". I''m sure I could just figure it out
2006 Jun 16
10
Issue with caching of .PNG files in IE..
I''m running a Rails application with WEBrick server. We are displaying
an Image from the server to the Client (Browser). First time on the
browser everything looks fine, upon clicking the link, it contacts the
server and displays in IE brwoser the image that was stored on the
server.
But in case if the image gets changed on the server(File Name being the
same), then even though i
2006 Apr 09
4
submitting forms help
I cant seem to figure this problem out and i was hoping someone could help
me out.
I have a page with a list of forms. I would like the user to be able to
submit each form individually, or submit them all at once, to a different
action (bascially, one that will do batch processing of all the forms).
Is this possble? Please help.
-------------- next part --------------
An HTML attachment was