<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<style type="text/css">
.submit{
padding:8px;
border:1px solid blue;
}
</style>
</head>
<body>
<h1>Disabled submit form button after clicked with jQuery</h1>
<form action="#">
<p>
I'm a form ~
</p>
<input type="submit" value="Submit"></input>
<button>Enable Submit Button</button>
</form>
<script type="text/javascript">
$('input:submit').click(function(){
$('p').text("Form submiting.....").addClass('submit');
$('input:submit').attr("disabled", true);
});
$('button').click(function(){
$('p').text("I'm a form ~").removeClass('submit');
$('input:submit').attr("disabled", false);
});
</script>
</body>
</html>
Both PRIMARY KEY and UNIQUE KEY enforces the Uniqueness of the values (i.e. avoids duplicate values) on the column[s] on which it is defined. Also these key’s can Uniquely identify each row in database table. Below table lists out the major difference between PRIMARY KEY and UNIQUE KEY : PRIMARY KEY UNIQUE KEY NULL It doesn’t allow Null values. Because of this we refer PRIMARY KEY = UNIQUE KEY + Not Null CONSTRAINT Allows Null value. But only one Null value. INDEX By default it adds a clustered index By default it adds a UNIQUE non-clustered index LIMIT A table can have only one PRIMARY KEY Column[s] A table can have more than one UNIQUE Key Column[s] CREATE SYNTAX Below is the sample example for defining a single column as a PRIMARY KEY column while creating a table: CREATE TABLE dbo.Customer ( Id IN...
Comments
Post a Comment