I have this form helper that I am using that updates a div within the
form upon completion. The action of the form runs a method that check
the validaty of a membership number. If it is a good number the number
is added to a list else it does a popup that indicates that this was not
a valid membership number. Everything upto that point works fine. Th
eproblem happens after I hit ''ok'' on the popup. When I do that
I get
garabage displayed in the div in the form of a try catch block. I think
that this might be a ruby bug, but does anyone have any ideas of how to
fix this? Here is some code:
The form tag:
<%= form_remote_tag :update => ''add_airline_table'',
:url => { :action
=> ''add_airline_table'', :id => @user.id }, :complete
=>
''document.getElementById("account_num").value =
"";'' %>
The alert box:
render :update do |page|
page.alert ''Invalid Membership Number''
end
The garabage:
try { alert("Invalid Membership Number"); } catch (e) {
alert(''RJS
error:\n\n'' + e.toString()); alert(''alert(\"Invalid
Membership
Number\");''); throw e }
Thanks,
~S
--
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 post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
It looks to me like your gsrbage is JavaScript. Are you replacing your div with a block of JavaScript? On Aug 1, 11:02 am, Shandy Nantz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have this form helper that I am using that updates a div within the > form upon completion. The action of the form runs a method that check > the validaty of a membership number. If it is a good number the number > is added to a list else it does a popup that indicates that this was not > a valid membership number. Everything upto that point works fine. Th > eproblem happens after I hit ''ok'' on the popup. When I do that I get > garabage displayed in the div in the form of a try catch block. I think > that this might be a ruby bug, but does anyone have any ideas of how to > fix this? Here is some code: > > The form tag: > > <%= form_remote_tag :update => ''add_airline_table'', :url => { :action > => ''add_airline_table'', :id => @user.id }, :complete => > ''document.getElementById("account_num").value = "";'' %> > > The alert box: > > render :update do |page| > page.alert ''Invalid Membership Number'' > end > > The garabage: > > try { alert("Invalid Membership Number"); } catch (e) { alert(''RJS > error:\n\n'' + e.toString()); alert(''alert(\"Invalid Membership > Number\");''); throw e } > > Thanks, > > ~S > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Robert Walker wrote:> It looks to me like your gsrbage is JavaScript. Are you replacing your > div with a block of JavaScript? > > On Aug 1, 11:02 am, Shandy Nantz <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Not intentialy. The part of the code that renders the alert is inside my add_airline_table method. When the method returns and a failure occurs, :update is left with nothing to update that div with, but somehow that garabage is bleeding through to the :update and displaying. I just don''t know how. I have tried several ways to display an empty string in the div without success. Whatever is happening is happening at the very last instance of updating the div. -- 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 post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---