I'm using toastr.js to display form validation messages, but using this plugin it disabled all my inputs that had the required
property.
My code:
<!DOCTYPE html>
<html>
<head>
<title>TOASTR</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script><linkrel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.js"></script></head><body><form><p>FirstName:<inputtype="text" name="firstname" required></p>
<p>Last Name: <input type="text" name="lastname" required></p>
<p><button class="btnsubmit" type="submit" value="submit" data-toastr="success" data-message="Thanks for your donate.">Submit</button></p>
</form>
<script>
toastr.options.closeButton = true;
$('[data-toastr="success"]').on('click', function (event) {
event.preventDefault();
toastr.success($(this).data('message'));
});
</script>
</body>
</html>
Does anyone know why?