$(document).ready(function(){preventDblClick();});
function stopEventPropagation(evt){
//remember "this" is the button which is the global scope
//of the event context. 
    if(this.hasClicked){
        return false;
    }
    else{
        this.hasClicked = true;
        return true;
    }
}

function preventDblClick(){
    //assign the handler to the submit button
    var submitInputs = $("input[type=submit]");
    submitInputs.click(stopEventPropagation);
}

