form and popup in RoR

It looks to me like your gsrbage is JavaScript. Are you replacing your
div with a block of JavaScript?

It looks to me like your gsrbage is JavaScript. Are you replacing your
div with a block of JavaScript?

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:

Get rid of the :update on the form_remote_tag if you are going to send back RJS to be evaluated. The RJS can do a page.replace_html if there's no error.

<%= 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
--

Rob Biedenharn http://agileconsultingllc.com
Rob@AgileConsultingLLC.com