npm upgrade at linux ubuntu

sudo npm install npm@latest -g
Advertisements

Preventing multi-submitting in html form with JQuery

<!DOCTYPE html>
<html lang=”en” class=”ie8″>
<html lang=”en”>
<head>
</head>
<body>
<form method=”POST” action=”http://localhost:8080/township/store&#8221; accept-charset=”UTF-8″ id=”townshipForm”>
<input type=”submit” name=”submit” value=”ADD” class=”btn_submit form-control btn-primary”>

$(document).ready(function() {
//Start Validation for Township Entry and Edit Form
$(‘#townshipForm’).validate({
rules: {
name : ‘required’
},
messages: {
name : ‘Township Name is required’
},
// Make sure the form is submitted to the destination defined
// in the “action” attribute of the form when valid
submitHandler: function(form) {
$(“.btn_submit”).attr(‘disabled’,’disabled’);
form.submit();
}
});
//End Validation for Township Entry and Edit Form

});

</body>
</html>