How do I enable and Disable the button with AJAX get error admin.php:15 Uncaught ReferenceError: $ is not defined
function validate() {
// Find the validation image div
var validationElement = document.getElementById('nameValidation');
// Get the form values
var password1 = document.forms["Admin"]["password1"].value;
var password2 = document.forms["Admin"]["password2"].value;
// Reset the validation element styles
validationElement.style.display = 'none';
validationElement.className = 'validation-image';
// Check if password2 isn't null or undefined or empty
$('#savepasswd').prop('disabled', true);
if (password2) {
// Show the validation element
validationElement.style.display = 'inline-block';
// Choose which class to add to the element
$('#savepasswd').removeAttr('disabled');
validationElement.className +=
(password1 == password2 ? ' validation-success' : ' validation-error');
}
}
PHP code.
$msg .= " <td><input type=\"submit\" name=\"savepasswd\" id=\"savepasswd\" value=\"Save Access\" class=\"inputadmin\"></td>
";