Multiple AJAX forms on same page

Today I have had very interesting case with drupal forms having #ajax buttons. One form was working but the other didn't. After some debugging on ajax.js file I have found out that ajax submit buttoms behaviors being attached to forms by id so it is critical that different buttons have different id's. And in my case I have named submit buttons the same name $form['submit'] and in this way they had same id "form-submit". So in order to avoid that only thing you need is to make keys of submit elements in form to be different and then box ajax submission behaviors work as expected.