user974047
user974047

Reputation: 2285

Error on Disable submit form button after submit on a JSP page

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

Answers (1)

Sreedhar
Sreedhar

Reputation: 85

use the following code

onsubmit="document.getElementById('submit').disabled = 1;"

let me know if it is not works.

Upvotes: 1

Related Questions