Thursday, December 27, 2012

Creating an ISO datestamp

The Basics of jQuery

Working with Geolocation and the Google Maps API with Javascript

Tuesday, October 30, 2012

Monday, October 29, 2012

Textbox accept digits

script language="javascript" type="text/javascript">
        function CheckNumeric(e) {

            if (window.event) // IE
            {
                if ((e.keyCode < 48 || e.keyCode > 57) & e.keyCode != 8) {
                    event.returnValue = false;
                    return false;

                }
            }
            else { // Fire Fox
                if ((e.which < 48 || e.which > 57) & e.which != 8) {
                    e.preventDefault();
                    return false;

                }
            }
        }
    
function IsNumeric(sText)
{
    var ValidChars = "0123456789.";

    //loop through the string passed in, iif its in the validchars list, continue, otherwise, return false
    for(i = 0; i < sText.length; i++) 
    { 
        if(ValidChars.indexOf(sText.charAt(i)) == -1) 
        {
            return false;
        }
    }

    return true;
}

function validateNumerical(evt)
{
    var theEvent = evt || window.event;
    var key = theEvent.keyCode || theEvent.which;
    key = String.fromCharCode( key );
    var regex = /[0-9,\.]/;
    if( !regex.test(key) )
    {
        theEvent.returnValue = false;
        if(theEvent.preventDefault)
        {
            theEvent.preventDefault();
        }
    }
}

    </script>
   
    <input type="text" onKeyPress="CheckNumeric(event)" />

Sunday, October 21, 2012

copy row from another table

INSERT INTO Table (foo, bar, Event_ID)
SELECT foo, bar, Event_ID+"155"
  FROM Table
 WHERE Event_ID = "120"

Friday, October 19, 2012

MySQL Joins

http://www.sitepoint.com/understanding-sql-joins-mysql-database/

Tuesday, October 16, 2012

Print only a part of the page

<div id="printableArea">
      <h1>Print me</h1>
</div>
<input type="button" onclick="printDiv('printableArea')" value="print a div!" />
 
 
 
function printDiv(divName) {
     var printContents = document.getElementById(divName).innerHTML;
     var originalContents = document.body.innerHTML;

     document.body.innerHTML = printContents;

     window.print();

     document.body.innerHTML = originalContents;
}

==========================================================================
using frames
==========================================================================
<html>
    <head>
        <title>Print Test Page</title>
        <script>
            printDivCSS = new String ('<link href="myprintstyle.css" rel="stylesheet" type="text/css">')
            function printDiv(divId) {
                window.frames["print_frame"].document.body.innerHTML=printDivCSS + document.getElementById(divId).innerHTML;
                window.frames["print_frame"].window.focus();
                window.frames["print_frame"].window.print();
            }
        </script>
    </head>

    <body>
        <h1><b><center>This is a test page for printing</center></b><hr color=#00cc00 width=95%></h1>
        <b>Div 1:</b> <a href="javascript:printDiv('div1')">Print</a><br>
        <div id="div1">This is the div1's print output</div>
        <br><br>
        <b>Div 2:</b> <a href="javascript:printDiv('div2')">Print</a><br>
        <div id="div2">This is the div2's print output</div>
        <br><br>
        <b>Div 3:</b> <a href="javascript:printDiv('div3')">Print</a><br>
        <div id="div3">This is the div3's print output</div>
        <iframe name="print_frame" width="0" height="0" frameborder="0" src="about:blank"></iframe>
    </body>
</html>
 

Thursday, September 27, 2012

Secure Textbox

Put these attributes in your textboxes to avoid many errors

onpaste="return false" ondrop="return false" ondrag="return false" oncopy="return false" autocomplete="off"

Friday, May 4, 2012

Zend Interview questions

http://rathinasamyy.blogspot.in/2011/09/zend-framework-interview-questions.html

Wednesday, February 8, 2012

Wednesday, January 18, 2012

Tuesday, January 10, 2012

Beginner SQL Tutorial

http://beginner-sql-tutorial.com/sql-query-tuning.htm

10 cloud startups to watch in 2012

5 things you should avoid in resume

What Your Body Language Says About You

Required soft skills in a fresher or Job seeker

7 common mistakes by job-seekers

11 Things Every Developer Should Know About the Cloud

Friday, January 6, 2012

Many cheet sheets

Linux commands cheat sheet

Google Maps Cheat sheet

How to make faster websites and enhance your site user experience

Javascript Cheat Sheet

ABHI's Blog for Web Developement

Cheat Sheets for Front-end Web Developers

10 Ways to Improve Your Web Page Performance