Monday, May 31, 2010

Wish My Friend a HappY BiRtHdAy

Many Happy Returns of the Day are Prashanth Kanse....

Happy Birthday
Leave a Scrap here to wish my friend........

Orange Stiped Mens Ties Blue Gift Ideas Man Formalwear Silk Necktie St6009  It's a Guy Thing Gift Basket - Great Gift for Father's Day or Birthdays  Belkin 15.4-Inch Messenger Bag (Jet/Cabernet)  Decorative All American Motorcycle Piggy Bank For Motorcycle Enthusiast Great Gift Item!S4025 NEW Designer Hand Made Blue Stripes Neck Tie Cufflinks with Presentation Box Ties for Men Jacquard Woven Pure Silk Mens Neck Tie and Cuff Links Gift SetPresident Barack Obama T-Shirt (We Will Change This Country And We Will Change The World) Shirt Great Gift Ideas for Adults, Men, Women, Youth, & Teens, Collectible Novelty ItemsFunny T-Shirts ~ Yet Despite The Look On My Face...You Are Still Talking ~ Humorous Slogans Comical Sayings Shirt; Novelty Item Made of 100% Cotton Adult Size (L) Large; Great Gift Idea (Mens, Youth, Teens, & Adults T-Shirts)Mustard Seed Tie Tack (Gold) - Christian Lapel Pin - A Christian Clothing Accessory - Christian Jewelry to Wear to Church - Great Gift Idea - Religious and for Anyone - Wonderful for Neck Ties and Clothing - Inexpensive Item - Encased Mustard Seed on a Gold Tac - Religious Meaning and Purpose - Jesus Spoke in Parables of the Mustard Seed - Mustard Seed Jewelry

Thursday, May 27, 2010

Round of a decimal value using Javascript

Function to round of the decimal value is shown below.

//Example to fix a decimal value to 2 decimal places when it has number of decimal places
var num = 234.8766;
var result = num.toFixed(2); //The result will be 234.88;

//to fix to a 2 decimal values if a number has no decimal values

var num = 8769;
var result = num.toFixed(2); //The result will be 8769.00;





Sony Cyber-shot DSC-T90 12.1 MP Digital Camera with 4x Optical Zoom and Super Steady Shot Image Stabilization (Silver)Sony Cybershot DSC-W220 12.1MP Digital Camera with 4x Optical Zoom with Super Steady Shot Image Stabilization (Black)  Sony Cyber-shot DSC-HX1 - Digital camera - compact - 9.1 Mpix - optical zoom: 20 x - supported memory: MS Duo, MS PRO Duo, MS PRO-HG Duo  Sony Cyber-shot DSC-W230 12 MP Digital Camera with 4x Optical Zoom and Super Steady Shot Image Stabilization (Dark Red)
Sony 4 GB Memory Stick PRO Duo Flash Memory Card MSMT4G   Sony LCSCSQ/B Soft Carrying Case for Sony T, W, and N Series Digital Cameras (Black)  Replacement Sony NP-BG1 Equivalent LithiumIon Camera Battery For SONY DSC-H9/DSC-H7/DSC-H3 /DSC-H50/DSC-W30/DSC-W35/DSC-W50/DSC-W55/DSC-W70Sony NPBN1 Rechargeable Battery Pack  

Sunday, May 23, 2010

How to Print a part of webpage using Javascript

<html>
<head>
<title>Print a part of HTML or Webpage using Javascript</title>
<script type="text/javascript">
function printDiv()
{
   var divToPrint=document.getEelementById('areaToPrint');
  newWin= window.open("");
  newWin.document.write(divToPrint.outerHTML);
  newWin.print();
  newWin.close();
}

</script>
</head>
<body>

<div id="areaToPrint">
The text you want to print or the content you want to print
</div>
</body>
</html>

---> The Javascript function can be called using an ANCHOR link or a onClickevent for a button or else in body onload function.

Friday, May 7, 2010

To Remove Suggestions for a textbox

Removing the suggestions or disable the autocompletion of a textbox. We need to add the tag in the textbox as shown below.

<input type='text' name='txtbox' autocomplete='off'>

or can be added in the form tag

<form autocomplete='off'>

Tuesday, May 4, 2010

How to check & uncheck all the checkboxes in a form

  The below function is used to check all the checkboxes & uncheck them in a form

checked = false;
function checkedAll () {
    if (checked == false){checked = true}else{checked = false}
             for (var i = 0; i < document.getElementById('myform').elements.length; i++) {
                   document.getElementById('myform').elements[i].checked = checked;
                  }
}

Monday, May 3, 2010

Setting a Website as Homepage in IE using Javascript

<form>
<input type="button" value="Make This Site Your Home Page" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://anilkajadoo.blogspot.com');">
</form>

****This works only in IE browser......