Wednesday 29 February 2012

Phone number validation using JS


if (txtPhone.value == '')
{
   alert("Please enter phone number.");
   txtPhone.focus();
   txtPhone.value='';
   txtPhone.style.border = '1px solid red';
   return false;
}
else if (txtPhone.value != "")
{
   var targ=txtPhone.value.replace(/[^\d]/g,''); // remove all non-digits
   if(!targ || isNaN(targ) || targ.length!=10)
    {
        alert("Invalid Phone number.");
        txtPhone.value = "";
        txtPhone.style.border = '1px solid red';
        txtPhone.focus();
        return false;
    }
}

How to find the Procedure Created and Modified date


SELECT name, create_date, modify_date FROM sys.objects
WHERE type = 'P'
order by 3 desc

Tuesday 28 February 2012

How to Scroll Images Regularly

<th height="129" bgcolor="#000000" scope="row">
<marquee height="600" bgcolor="#000000" behavior="alternate" direction="down">
<img width="234" height="181" src="image/nexttdaytech.jpg">
<img width="234" height="181" src="image/quants.jpg">
<img width="234" height="181" src="image/java.jpg">
<img width="234" height="181" src="image/connelly.jpg">
<img width="234" height="181" src="image/1.jpg">
<img width="234" height="181" src="image/JobPlacement.jpg">
<img width="234" height="181" src="image/header_placement.jpg">
<img width="234" height="181" src="image/placement.jpg">
<img width="234" height="181" src="image/placement.gif">
</marquee>
</th>

OR

<div style="float: left;height: 180px;padding: 10px;width: 210px;>
<marquee direction="up" scrollamount="2" behavior="scroll"><p>An Adobe&reg; Dreamweaver&reg; CS3 site is a collection of all of the files and assets in your website. You can create web pages on your computer, upload them to a web server, and maintain the site by transferring updated files whenever you save them.</p><br>
        <p class="smallblue">Sanjeet(Web Developer)<br>Passion</p>
        <p class="smallblue">&nbsp;</p>
        </marquee>
</div>