Try catch error


#1

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”
end

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,

~S