My problem is very simple
$(\'#button\').removeAttr(\'type\');
triggers an error on firebug
type property can\'t be changed
Since you just want to disable the submit button:
If you are using jQuery < 1.6 do this:
$("#button").attr("disabled", 'disabled');
If you are using jQuery 1.6+:
$("#button").prop("disabled", true);
See this question: .prop() vs .attr() for references why.