Reputation: 2285
So I have a form and I would like to disable the submit 'button' on the form after the user has clicked on it once to prevent multiple submits, and I was wondering how I will be able to achieve this result. So the code goes something like this:
<form id = "id" name= "blah" method = "post" onsubmit="$('input[type=submit]').attr('disabled', 'disabled');" ...>
items for the form goes here
<input title="Save" type="submit" value="Save" tabindex="20"/>
But I'm getting an error in the console: "Error: The value of the property '$' is null or undefined, not a Function object"
Upvotes: 0
Views: 767
Reputation: 85
use the following code
onsubmit="document.getElementById('submit').disabled = 1;"
let me know if it is not works.
Upvotes: 1