Question: hi there I wanted to use Ajax in a drop down list using Drupal form API. the problem is that i want to prevent the user submit the form before the Ajax response from server comes back. how it is possible to disable the submit button or to prevent any other user actions when the select list state is being changed and the server is responding to the request.
beside I'm using drupal 7 with a simple form which ajax has been attached to the combo box select list

Answer: 
Ajax in Drupal has a public method called .ajaxStart

You can do a 

```
jQuery('#form_id').ajaxStart(function(){  //Here you prevent shit } );

```

And also has a method named .ajaxSuccess for the finish action
Its just a trick that you should use to prevent submitting during ajax loading.
During ajax loading just disabled the submit button and enable it on success.
Like that:
Suppose submit button's id is: submit\_button, then

```
$("#submit_button").attr("disabled", "disabled");

$.ajax({
  url: 'html-data/demo.html',
  success: function(data) {
    $('#resultDiv').html(data);
    $('#submit_button').removeAttr("disabled");
  }
});

```

above code is in jquery and it will work in Drupal.
Check it.