I'm sure this is very simple, I'm quite very new to JavaScript. I have a function for submitting a form, I'd like it to stop the user from submitting the form multiple times once they have clicked it. I haven't found a way to do this in the docs. Can anyone point me in the right way?
My function looks like this: function submitComments(id, numComments) { $('#response-'+id).fadeIn('fast'); $('#commentForm-'+id).ajaxForm({ target: '#response-'+id, success: function() { loadComments(id, numComments); $('#commentValue-'+id).val('Speak your brains! ') }}); }