for some reason the controller is parsing everything fine, but the return is a page instead of code execution. I have other ajax forms no listed that are also running fine on this same page.
there are supposed to be 3 ajax events: onblur event that calls a function to submit - doesn't work. There is a submit button at the end of the form - works there is a delete image that removed the row when clicked - works
I have also tried the onblur event just as this.form.submit(); Either case, I get the following which looks OK, just not running. try { update_row(16, "12345678", 24, 14, 100, 75); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('update_row(16, \"12345678\", 24, 14, 100, 75);'); throw e }
In my controller I've tried using page.call and just tried a page.insert as well, but no dice.
The controller code is pretty standard .... render :update do |page| page.call "update_row", id,v1,v2,v3,v4,v5 end
Here is a chunk of the rendered html, sorry, its not very pretty.
<SCRIPT type="text/javascript"> function submit_form(obj, form_id) { document.getElementById(form_id).submit(); } </script> .....
<form action="/assignment/update_assignment/16" id="frm_16" method="post" onsubmit="new Ajax.Request('/assignment/update_assignment/16', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this) + '&authenticity_token=' + encodeURIComponent('***')}); return false;">
<div style="margin:0;padding:0"> <input name="authenticity_token" type="hidden" value="***" /> </div> <input class='reg_c' value='12345678' onblur="submit_form(this,'frm_16')"> <input type='submit'> </form>
<form action="/assignment/delete_assignment/16" method="post" onsubmit="new Ajax.Request('/assignment/delete_assignment/16', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this) + '&authenticity_token=' + encodeURIComponent('***')}); return false;">
<div style="margin:0;padding:0"> <input name="authenticity_token" type="hidden" value="***" /> </div>
<input type='image' src='/images/delRow.gif' alt='delete row'> </form>