javascriptで二度押し防止

javascriptでsubmitの二度押し防止方法。

<%nobr%>

<%estag%>
function disableSubmit(form) {
var elements = form.elements;
for (var i = 0; i < elements.length; i++) {
if (elements[i].type == 'submit') {
elements[i].disabled = true;
}
}
}





<%/estag%>

<%/nobr%>