Welcome to Sudeep Pandey

Just for sharing ideas and knowledge— My Blog

Archive for November, 2009

How to use watermark using jquery

Posted by Sudeep Pandey on November 18, 2009

script for jquery

$(document).ready(function() {
$(“.watermark”).focus(function() {
if ($(this).val() == this.defaultValue)
{
$(this).val(“”);
}
}
);

$(“.watermark”).blur(function() {
if ($.trim($(this).val()) == “”)
{
$(this).val(this.defaultValue);
}
}
);
}
);

css for watermark
.watermark
{
color: #ccc;
}

input text for watermark using asp.net textbox control

Posted in JavaScript | Leave a Comment »

Drop table if exist and create table (SQL Server)

Posted by Sudeep Pandey on November 14, 2009

IF EXISTS(SELECT 1 FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(‘table2′) AND type = ‘U’)
DROP TABLE table2
create table table2(lname varchar(20))

Note: type=’U’ means the object type is for table

Posted in SQL Server | Leave a Comment »