I have the following HTML:
<input class=button name=save onclick=$(this).replaceWith('<img src=http://www.example.com/images/ajax-loader.gif />'); type=submit value=SUBMIT>
When clicking on the button, the form no longer attempts to submit, but replaces itself with a turning AJAX loading gif and does nothing. If I remove the onclick portion, it submits.
Long story, this is for a client, but I can't give them the same thing in the form of
$(function() { $(input[name=save]).on({click:function() { $(this).replaceWith(...); } }); });
Why won't this still submit after replacing itself? I'm not e.preventDefault()
'ing anywhere.