I've written the below from memory, I have used something similar in the past for exactly this situation...
var submitCount = 0;
if (submitCount == 0)
alert("Please wait, lengthy query executing...");
<input type="button" onClick="doSubmit();">