Forum: Ruby on Rails try catch error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Shandy N. (Guest)
on 2007-07-31 19:14
I have a form that allows the user to enter membership info. If the
membership is a good one, it is allowed, but if not a prompt incates
that it was bad. After you click ok on that prompt, a try catch error
appears in the div that get updated when the user enters correct info

try { alert("Invalid Membership Number");
Element.update("add_airline_table", " "); } catch (e) { alert('RJS
error:\n\n' + e.toString()); alert('alert(\"Invalid Membership
Number\");\nElement.update(\"add_airline_table\", \" \");'); throw e }

The code is pretty straight forward:

   render :update do |page|
        page.alert "Invalid Membership Number"

I'm trying to figure out how to stop this behavoir. Another thing is
that, in my form I have an :update hash which updates the div where this
error appears. Basically, the div gets only updated when the user enters
correct info and nothing when bad info is entered. Thanks,

This topic is locked and can not be replied to.