For a form, I have a submit button, that posts a form using ajax. When this form is loading, I want to display a spinner right next to the button. This may seem like this question: jQuery UI Dialog, adding elements next to a button, but the difference is that in that post, the question is to display an icon in the left corner. Plus, the solutions proposed aren't working for me.
I have tried the following (from the other thread):
var $respond_dialog = $( "#respond_div" ).dialog({
width: 500,
autoOpen: false,
resizable: true,
modal: true,
buttons: {
"Reageren": function() {
$('<div style="width:20px;height:20px;float:right;"
class="ui-autocomplete-loading"></div>').insertBefore(
$("#respond_div").next('.ui-dialog-buttonpane > button:first'));
...
but this does nothing. If I remove the >, I get a spinner, but it is displayed like this:

How can I fix this?
edit: What I want is this:

Fiddle: http://jsfiddle.net/vpwjw/10/