I have a form with <input type="submit id="no-js-submit">
.
If Javascript is enabled I am removing this submit
-input field by $('#no-js-submit').remove();
and add the "fire-ajax"-button with
$('<button id="fire-ajax" type="button">Fire Ajax</button>').appendTo('#tk-form');
.
So, if JavaScript is enabled (and if jQuery is able to remove the submit-input field) the form's values will be transfered to the server by ajax.
If JS is disabled (and therefore jQuery cannot remove the submit-input) the form's values will be submitted by the <input type="submit id="no-js-submit">
.
What do you think about this solution? Is there any browser (in-)compatibility I should worry about? Furthermore, is there any best practice to this?