Displaying 20 results from an estimated 30000 matches similar to: "RJS form validation"
2006 Jul 21
0
Selecting customers and addresses in a form (was Getting joined collections on a form)
(Sorry if you have received this twice, I''m having trouble sending mail to
the rails list)
Greetings, I''m looking for suggestions on how to simplify getting customer
addresses on a form:
I''m jumping between controller and view several times; alternating between
rhtml and rjs, in order to display customers and their addresses on an
invoicing form. It''s very
2006 Jul 20
0
Getting joined collections on a form
Greetings, I''m looking for suggestions on how to simplify getting customer
addresses on a form:
I''m jumping between controller and view several times; alternating between
rhtml and rjs, in order to display customers and their addresses on an
invoicing form. It''s very messy.
I have a one to many relationship between Customer and Addresses, each
customer has one or more
2006 Mar 23
4
RJS and Form Validation (Best Practice)
Hello All !
I''ve been using RJS extensively, but haven''t done any form validation with
it until now.
Should I be manually passing the RJS template some models error messages
from the controller.... or
... should I be using error_messages_for in order to do the display ?
I''ve implemented the first approach, but it seems like quite a hack.
Any insight would be greatly
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'',
2006 May 23
0
RJS replace adding multiple inputs
Hi,
I have a classic problem. I want to replace a hidden field inside a
form with a hidden field with some value when a link_to_remote is
pressed. In the link''s action rjs, I''m doing the following:
Assume my form has the following field already
<%= hidden_field(''client'', ''company_id'') $>
So I have a bunch of companies in a list with
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 Mar 31
5
RoR 1.1 RJS problem
I''ve been playing with the new RJS stuff in RoR1.1, and I have to say
that I''m am extremely impressed, NICE! work guys. However, I seem to be
having a bit of a problem. I promise, I''ve googled the hell out of it
and haven''t found an answer.
Set up: Putting together a little proof of concept app. Display a form
(index.rhtml) that just has a button to
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.
2006 Apr 11
5
RJS adds comment but doesn''t update form
Hi,
When a user adds a comment i want to add the comment to the end of the
comments list using ajax so there is no full page refresh. The code i
have below adds the comment to the database but doesn''t update the
comments div with the new comment.
Can anyone help? This is my first use of rjs templates and i have read
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
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 Jul 08
1
Ajax, RJS, and Standard Form Errors
Hi all,
I''m trying to take the standard scaffold and add a bit for ajax to it. I
have a two column page with the list on the left and the right side is
reserved for the create/edit actions. On a successful save my rjs executes
and updates the list view on the left and returns the right side to a "home"
page. However, if one of the model validations fail I use rjs ro
2005 Dec 15
0
RJS Templates and the Replace semantics
I have an issue with the way replace_html works in an RJS template.
This is a copy of a post on my blog (http://blog.craz8.com
<http://blog.craz8.com/> ) that describes the problem and my working
solution to the problem.
If I have a collection of things that are output like this:
<div id="things">
<% @things.each do |thing| %>
<%= render :partial =>
2006 Jul 21
0
Ajax page.replace_html model validation errors
I have the following setup:
A model: that validates using helpers like: validates_presence_of, etc..
A view: called ''new'' which renders a partial
The partial: _form which has error_messages_for and a
form_remote_tag , submit_tag and end_form_tag
An action ''create'': that gets executed via the submit_tag in the
_form and which
in case it can''t
2006 Jul 24
0
Ajax page.replace_html model validation render partial errors
Hi; I have the following setup:
A model: that validates using helpers like: validates_presence_of, etc..
A view: called ''new'' which renders a partial
The partial: _form which has error_messages_for and a
form_remote_tag , submit_tag and end_form_tag
An action ''create'': that gets executed via the submit_tag in the
_form and which
in case it can''t
2006 Aug 02
0
"RJS Error: TypeError: $(element) has no properties"
i have lots of divs, which are added via link_to_remote. now i want to
delete them with a link_to_remote button for each. i am giving them ids
with the same name and a serialized number. when trying to access them
with javascript/rjs, strange things happen: "RJS Error: TypeError:
$(element) has no properties?. is this a rails, rjs or prototype bug? or
am i missing something?
see my code
2006 Jul 04
0
Help with first AJAX action
I''ve used Rails for a while, but haven''t really done any AJAX until
now. Now I''ve been fighting for days with my first AJAX action and
after reliably crashing Safari and throwing errors in IE, I''m finally
coming to the list for help. :)
I have a "controls" div in my layout. This div displays a list of
page-specific actions. When some of these
2006 Apr 21
3
rjs in multiple ajax page
Sorry for the long explanation but I''m having trouble integrating rjs into my
form page. Here''s my page:
<div id="posts">
<ul id="post_list"><%= render :partial => ''list_results'', :collection =>
@posts %></ul>
<p><%= link_to_remote(''+'',
:url => {:action =>
2006 Nov 04
0
RJS not setting form input value correctly
Good day.
I have spent almost 2 days on this issue.
I have asked everyone from my Rails expert to my Javasript expert and we can
not for the life of us figure out the issue with this one form element.
I have a form which contains several readonly/disabled (firefox/ie) form
elements.
ALL elements in the form are updated correctly EXCEPT this one form element.
The form element in the view looks as
2006 Jul 05
2
RJS - Getting and Setting Form Element Values Question
I''m still a beginner with RJS so forgive me if this is a simple one -
but certainly it doesn''t seem logical and googling has not led to .
Given a field with an id of ''posting_subject'' I can do the following in
my controller with RJS.
render :update do | page |
subject = ''this is really something
2006 Apr 22
3
rjs woes, any hints?
I''ve pared my rjs experiment down to what seems a bare minimum. When I click
on my link_to_remote, the rjs executes, returns the correct javascript to
the browser, but it doesn''t update the div I''ve specified. What appears to
be coming back from the controller is:
Element.update("my_form", "hello, rjs");
I''m tearing my hair out.