Javascript all key validation
function validateNumberKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key < 48 || key > 57 ) {
return false;
}
else return true;
}
function validateAlphaNumericKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key >= 48 && key <= 57 )
{
return true;
}
else if ( key >= 65 && key <= 90 )
{
return true;
}
else if ( key >= 97 && key <= 122 )
{
return true;
}
else return false;
}
function validateAlphabeticKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key >= 65 && key <= 90 )
{
return true;
}
else if ( key >= 97 && key <= 122 )
{
return true;
}
else return false;
}
Number :
AlphaNumeric :
Alphabetic :
If you are searching for the professional web development, app development company in Vadodara then Cloudswift Solutions is the name on which you can trust. Visit our website for more information.
Wednesday, 27 June 2012
Saturday, 23 June 2012
Create table through javascript
Javascript all key validation
function validateNumberKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key < 48 || key > 57 ) {
return false;
}
else return true;
}
function validateAlphaNumericKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key >= 48 && key <= 57 )
{
return true;
}
else if ( key >= 65 && key <= 90 )
{
return true;
}
else if ( key >= 97 && key <= 122 )
{
return true;
}
else return false;
}
function validateAlphabeticKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key >= 65 && key <= 90 )
{
return true;
}
else if ( key >= 97 && key <= 122 )
{
return true;
}
else return false;
}
Number :
AlphaNumeric :
Alphabetic :
function validateNumberKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key < 48 || key > 57 ) {
return false;
}
else return true;
}
function validateAlphaNumericKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key >= 48 && key <= 57 )
{
return true;
}
else if ( key >= 65 && key <= 90 )
{
return true;
}
else if ( key >= 97 && key <= 122 )
{
return true;
}
else return false;
}
function validateAlphabeticKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key >= 65 && key <= 90 )
{
return true;
}
else if ( key >= 97 && key <= 122 )
{
return true;
}
else return false;
}
Number :
AlphaNumeric :
Alphabetic :
Display image at the center of content
function displayImage($intGetWidth,$intGetHeight,$intNewWidth,$intNewHeight)
{
$intWidth = $intNewWidth;
$intHeight = $intNewHeight;
if( $intGetWidth > $intNewWidth)
{
$intWidth = $intNewWidth;
$intHeight = (($intGetHeight * $intNewWidth)/$intGetWidth);
}
if($intHeight > $intNewHeight)
{
$intHeight = $intNewHeight;
$intWidth = (($intWidth * $intNewHeight)/$intHeight);
}
return array($intWidth,$intHeight);
}
$intNewWidth = 100;
$intNewHeight = 100;
$strSource = "image/Google22.jpg";
$arrDimensions = getimagesize($strSource);
$intOrigionalWidth = $arrDimensions[0];
$intOrigionalHeight = $arrDimensions[1];
$intNewDim = displayImage($intOrigionalWidth,$intOrigionalHeight,$intNewWidth,$intNewHeight);
$intWhiteWidth = (($intNewWidth - $intNewDim[0])/2);
$intWhiteHeight = (($intNewHeight - $intNewDim[1])/2);
?>

PHP Script header cannot send problem solutions
if(!isset($_SESSION["email"]))
{
if(!headers_sent())
{
$strRedirectUrl = $site['url'].'admin/index.php';
header("Location:".$strRedirectUrl);
}
else
{
$strRedirectUrl = $site['url'].'admin/index.php';
?>
{
if(!headers_sent())
{
$strRedirectUrl = $site['url'].'admin/index.php';
header("Location:".$strRedirectUrl);
}
else
{
$strRedirectUrl = $site['url'].'admin/index.php';
?>
location.href = '';
}
}
}
PHP Read curl data
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://api.google.com/v1/jobsearch?&DeveloperKey=WDH38FQ65G6P0DTBZ09C&Keywords=php&PageNumber=1");
curl_setopt ($curl,CURLOPT_RETURNTRANSFER,1);
$data = curl_exec ($curl);
curl_setopt ($curl, CURLOPT_URL, "http://api.google.com/v1/jobsearch?&DeveloperKey=WDH38FQ65G6P0DTBZ09C&Keywords=php&PageNumber=1");
curl_setopt ($curl,CURLOPT_RETURNTRANSFER,1);
$data = curl_exec ($curl);
$arrData = simplexml_load_string($data);
/*echo "
/*echo "
";
print_r($arrData);*/
echo "
Total Result : ".$arrData->TotalCount."
";
echo "
echo "
Total Pages : ".$arrData->TotalPages."
";
echo "
echo "
Limit Start : ".$arrData->FirstItemIndex."
";
echo "
echo "
Limit End : ".$arrData->LastItemIndex."
";
echo "
";
echo "
echo "
";
echo "
"; echo "";echo "";
echo "Description";
echo "Date";
echo "";
foreach($arrData->Results->JobSearchResult as $key=>$obj)
{/*$arrvalues[] = array(
'location'=>$obj->Location,
'company_name'=>$obj->Company,
'description'=>$obj->DescriptionTeaser,
'date_added'=>$obj->PostedDate
);*/
$arrvalues[] = array(
'title'=>(string)$obj->JobTitle,
'location'=>(string)$obj->Location,
'company_name'=>(string)$obj->Company,
'description'=>(string)$obj->DescriptionTeaser,
'date_added'=>(string)$obj->PostedDate
);
echo "
";echo "".$obj->Location."";
echo "".$obj->DescriptionTeaser."";
echo "".$obj->PostedDate."";
echo "";
}
/*echo "";
print_r($arrvalues);*/
echo "
echo "Description";
echo "Date";
echo "";
foreach($arrData->Results->JobSearchResult as $key=>$obj)
{/*$arrvalues[] = array(
'location'=>$obj->Location,
'company_name'=>$obj->Company,
'description'=>$obj->DescriptionTeaser,
'date_added'=>$obj->PostedDate
);*/
$arrvalues[] = array(
'title'=>(string)$obj->JobTitle,
'location'=>(string)$obj->Location,
'company_name'=>(string)$obj->Company,
'description'=>(string)$obj->DescriptionTeaser,
'date_added'=>(string)$obj->PostedDate
);
echo "
";echo "".$obj->Location."";
echo "".$obj->DescriptionTeaser."";
echo "".$obj->PostedDate."";
echo "";
}
/*echo "";
print_r($arrvalues);*/
echo "
| Location |
|---|
";
curl_close ($curl);
?>
curl_close ($curl);
?>
PHP Resize image on both side
function fnCreatBigThumbnail($strSourcePath,$strFilename,$strDestinationPath,$intGetWidth,$intGetHeight)
{
$strSourcePath = $strSourcePath.$strFilename;
$info = pathinfo($strSourcePath);
if (strtolower($info['extension']) == 'jpg') {$img = imagecreatefromjpeg( "{$strSourcePath}");}
elseif(strtolower($info['extension']) == 'gif'){$img = imagecreatefromgif( "{$strSourcePath}");}
elseif(strtolower($info['extension']) == 'png'){$img = imagecreatefrompng( "{$strSourcePath}");}
{
$strSourcePath = $strSourcePath.$strFilename;
$info = pathinfo($strSourcePath);
if (strtolower($info['extension']) == 'jpg') {$img = imagecreatefromjpeg( "{$strSourcePath}");}
elseif(strtolower($info['extension']) == 'gif'){$img = imagecreatefromgif( "{$strSourcePath}");}
elseif(strtolower($info['extension']) == 'png'){$img = imagecreatefrompng( "{$strSourcePath}");}
$intNewWidth = $intOrigionalWidth = imagesx( $img );
$intNewHeight = $intOrigionalHeight = imagesy( $img );
$intNewHeight = $intOrigionalHeight = imagesy( $img );
if($intOrigionalWidth > $intGetWidth)
{
$intNewWidth = $intGetWidth;
$intNewHeight = (($intOrigionalHeight * $intGetWidth)/$intOrigionalWidth);
}
if($intNewHeight > $intGetHeight)
{
$intNewHeight = $intGetHeight;
$intNewWidth = (($intOrigionalWidth * $intGetHeight)/$intOrigionalHeight);
}
{
$intNewWidth = $intGetWidth;
$intNewHeight = (($intOrigionalHeight * $intGetWidth)/$intOrigionalWidth);
}
if($intNewHeight > $intGetHeight)
{
$intNewHeight = $intGetHeight;
$intNewWidth = (($intOrigionalWidth * $intGetHeight)/$intOrigionalHeight);
}
$tmp_img = imagecreatetruecolor($intGetWidth,$intGetHeight);
$strWhiteBackground = imagecolorallocate($tmp_img, 255, 255, 255);
imagefill($tmp_img, 0, 0, $strWhiteBackground);
$strWhiteBackground = imagecolorallocate($tmp_img, 255, 255, 255);
imagefill($tmp_img, 0, 0, $strWhiteBackground);
$floatWhiteWidth = (($intGetWidth - $intNewWidth)/2);
$floatWhiteHeight = (($intGetHeight - $intNewHeight)/2);
$floatWhiteHeight = (($intGetHeight - $intNewHeight)/2);
imagecopyresized( $tmp_img, $img, $floatWhiteWidth, $floatWhiteHeight, 0, 0, $intNewWidth, $intNewHeight, $intOrigionalWidth, $intOrigionalHeight );
if(strtolower($info['extension']) == 'jpg'){imagejpeg($tmp_img,"{$strDestinationPath}{$strFilename}");}
elseif(strtolower($info['extension']) == 'gif'){imagegif( $tmp_img, "{$strDestinationPath}{$strFilename}");}
elseif(strtolower($info['extension']) == 'png'){imagepng( $tmp_img, "{$strDestinationPath}{$strFilename}");}
}
if(isset($_REQUEST["submit"]))
{
$type = strtolower($_FILES['file']['type']);
if(($type=="image/gif")||($type=="image/jpeg") ||($type=="image/png") ||($type=="image/jpeg"))
{
move_uploaded_file($_FILES['file']['tmp_name'],'upload/'.$_FILES['file']['name']);
$strSourcePath = "upload/";
$strFilename = $_FILES['file']['name'];
$strDestinationPath = "resize/";
fnCreatBigThumbnail($strSourcePath,$strFilename,$strDestinationPath,935,440);
}
else
{
echo "Invalid value";
}
}
elseif(strtolower($info['extension']) == 'gif'){imagegif( $tmp_img, "{$strDestinationPath}{$strFilename}");}
elseif(strtolower($info['extension']) == 'png'){imagepng( $tmp_img, "{$strDestinationPath}{$strFilename}");}
}
if(isset($_REQUEST["submit"]))
{
$type = strtolower($_FILES['file']['type']);
if(($type=="image/gif")||($type=="image/jpeg") ||($type=="image/png") ||($type=="image/jpeg"))
{
move_uploaded_file($_FILES['file']['tmp_name'],'upload/'.$_FILES['file']['name']);
$strSourcePath = "upload/";
$strFilename = $_FILES['file']['name'];
$strDestinationPath = "resize/";
fnCreatBigThumbnail($strSourcePath,$strFilename,$strDestinationPath,935,440);
}
else
{
echo "Invalid value";
}
}
fnCreatThumbnail(TEMPLATEPATH.'/images/banners/','abc.jpg',TEMPLATEPATH.'/images/banners/large/',300,300);
Javascript get screen height and width
function fnGetScreenSize()
{
var screenW = 640, screenH = 480;
if (parseInt(navigator.appVersion)>3)
{
screenW = screen.width;
screenH = screen.height;
}
else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled())
{
var jToolkit = java.awt.Toolkit.getDefaultToolkit();
var jScreenSize = jToolkit.getScreenSize();
screenW = jScreenSize.width;
screenH = jScreenSize.height;
}
return screenW;
}
intWidth = fnGetScreenSize();
{
var screenW = 640, screenH = 480;
if (parseInt(navigator.appVersion)>3)
{
screenW = screen.width;
screenH = screen.height;
}
else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled())
{
var jToolkit = java.awt.Toolkit.getDefaultToolkit();
var jScreenSize = jToolkit.getScreenSize();
screenW = jScreenSize.width;
screenH = jScreenSize.height;
}
return screenW;
}
intWidth = fnGetScreenSize();
Apply Class through javascript
jQuery('body').addClass('width1024');
jQuery('.main-container').css('min-height',screen.height);
Iframe code to display google map
http://maps.google.co.in/maps?source=s_q&hl=en&geocode=&q=Mayank+M+Patel,+1,+PatelFaliyu,+Unn,+Udhana-Navsari+Main+Rd,&aq=0&sll=21.125498,81.914063&sspn=42.891601,56.513672&vpsrc=6&ie=UTF8&hq=Mayank+M+Patel,+1,+Patel+Faliya,+Unn,+Udhana-Navsari+Main+Rd,&hnear=Udhana+Zone,+Surat,+Gujarat&ll=21.109609,72.862124&spn=0.073774,0.049263&t=m&output=embed
View Larger Map
View Larger Map
Javascript Checkall Code
function fnCheckAll()
{
var nam="";
var mainchk = document.frmManage.mycheckbox;
var chklen = document.frmManage.elements.length;
if(mainchk.checked==true)
{
for(var n=0; n {
nam="check"+ n;
var currobj = document.getElementById(nam);
if(currobj.type == "checkbox" )
currobj.checked=true;
}
}
else if(mainchk.checked==false)
{
for(var n=0; n= 0)
{
allInputs = document.getElementsByTagName("input");
var flag=1;
for (i = 0; i< allInputs.length; i++)
{
if (allInputs[i].checked==true)
{
flag=0;
}
}
if (flag != 0 )
{
alert("Please select at least one.");
return false;
}
else
{
if(confirm('Are You Sure Want To Delete Selected Employee?'))
{
document.frmManage.submit();
}
}
}
}
{
var nam="";
var mainchk = document.frmManage.mycheckbox;
var chklen = document.frmManage.elements.length;
if(mainchk.checked==true)
{
for(var n=0; n
nam="check"+ n;
var currobj = document.getElementById(nam);
if(currobj.type == "checkbox" )
currobj.checked=true;
}
}
else if(mainchk.checked==false)
{
for(var n=0; n= 0)
{
allInputs = document.getElementsByTagName("input");
var flag=1;
for (i = 0; i< allInputs.length; i++)
{
if (allInputs[i].checked==true)
{
flag=0;
}
}
if (flag != 0 )
{
alert("Please select at least one.");
return false;
}
else
{
if(confirm('Are You Sure Want To Delete Selected Employee?'))
{
document.frmManage.submit();
}
}
}
}
for($intI=0;$intI
Bulk Action :
Please Select
Javascript Disable Select
function disableselect(e)
{
return false;
}
function reEnable()
{
return true
}
function enable_select()
{
document.onselectstart=new Function ("return true")
document.oncontextmenu=new Function ("return true")
//if NS6
if (window.sidebar)
{
document.onmousedown="";
document.onclick="";
}
}
function disable_select()
{
//if IE4+
document.onselectstart=new Function ("return false")
document.oncontextmenu=new Function ("return false")
//if NS6
if (window.sidebar)
{
document.onmousedown=disableselect
document.onclick=reEnable
}
}
{
return false;
}
function reEnable()
{
return true
}
function enable_select()
{
document.onselectstart=new Function ("return true")
document.oncontextmenu=new Function ("return true")
//if NS6
if (window.sidebar)
{
document.onmousedown="";
document.onclick="";
}
}
function disable_select()
{
//if IE4+
document.onselectstart=new Function ("return false")
document.oncontextmenu=new Function ("return false")
//if NS6
if (window.sidebar)
{
document.onmousedown=disableselect
document.onclick=reEnable
}
}
| this is second label |
Javascript Set Timeout
window.setTimeout(fnRedirecTo,1000);
function fnRedirecTo()
{
if(document.getElementById("first").style.display=="none")
{
document.getElementById("first").style.display="block";
setTimeout(fnRedirecTo,1000);
}
else
{
document.getElementById("first").style.display="none";
setTimeout(fnRedirecTo,1000);
}
}
function fnRedirecTo()
{
if(document.getElementById("first").style.display=="none")
{
document.getElementById("first").style.display="block";
setTimeout(fnRedirecTo,1000);
}
else
{
document.getElementById("first").style.display="none";
setTimeout(fnRedirecTo,1000);
}
}
Javascript Image Preload
jQuery(document).ready(function() {
jQuery('img').each(function(){
var imageObj = new Image();
imageObj.src = this.src;
});
});
jQuery('img').each(function(){
var imageObj = new Image();
imageObj.src = this.src;
});
});
Disable Right Click On Image
function disableRightClick()
{
var anchors = document.getElementsByTagName('img');
for (var i = 0; i < anchors.length; i++)
{
anchors[i].oncontextmenu = new Function("return false");
}
}
{
var anchors = document.getElementsByTagName('img');
for (var i = 0; i < anchors.length; i++)
{
anchors[i].oncontextmenu = new Function("return false");
}
}
Iframe call
function callIframe(strUrl,height,width)
{
document.getElementById('companyiframe').src = strUrl;
document.getElementById('companyiframe').style.height = height;
document.getElementById('companyiframe').style.width = width;
document.getElementById('companyiframe').style.border = 'none';
}
{
document.getElementById('companyiframe').src = strUrl;
document.getElementById('companyiframe').style.height = height;
document.getElementById('companyiframe').style.width = width;
document.getElementById('companyiframe').style.border = 'none';
}
var url = "http://192.168.0.1/";
callIframe(url,"400px","710px");
callIframe(url,"400px","710px");
Friday, 22 June 2012
Magento Themes Link
http://www.design4magento.com/free-magento-themes/
http://www.smashingmagazine.com/2010/06/03/download-a-free-magento-theme-hellowired/
http://www.tmdhosting.com/templates/free-magento-themes.html
http://pelfusion.com/freebies/15-free-high-quality-magento-templates/
http://www.modny73.com/inspiration/27-free-magento-themes-for-download/
http://www.tmdhosting.com/templates/free-wordpress-themes.html
http://www.magento-templates.com/free-magento-templates/
http://www.freewebtemplates.com/
http://www.smashingmagazine.com/2010/06/03/download-a-free-magento-theme-hellowired/
http://www.tmdhosting.com/templates/free-magento-themes.html
http://pelfusion.com/freebies/15-free-high-quality-magento-templates/
http://www.modny73.com/inspiration/27-free-magento-themes-for-download/
http://www.tmdhosting.com/templates/free-wordpress-themes.html
http://www.magento-templates.com/free-magento-templates/
http://www.freewebtemplates.com/
Magento Blog Links
http://www.fontis.com.au/blog/magento/
http://ommune.com/adding-new-currency-symbol-of-indian-rupee-inr-in-magento/
http://magentosnippet.blogspot.in/
http://magento-talks.blogspot.in/2011_09_01_archive.html
http://xhtmlandcsshelp.blogspot.in/2011/02/absolute-path-of-base-directory-in.html
http://magentocookbook.wordpress.com/category/magento-coding/
http://www.designer-daily.com/magento-tips-17085
http://www.learnmagento.org/page/4/
http://magebase.com/
http://www.magthemes.com/magento-blog/
http://amilan.wordpress.com/2008/05/
http://www.catgento.com/
http://spenserbaldwin.com/2010/03
http://magentoexpert.blogspot.in/2010/02/restrict-access-to-magento-during.html
http://keertikiran.blogspot.in/search/label/Magento
http://ommune.com/adding-new-currency-symbol-of-indian-rupee-inr-in-magento/
http://magentosnippet.blogspot.in/
http://magento-talks.blogspot.in/2011_09_01_archive.html
http://xhtmlandcsshelp.blogspot.in/2011/02/absolute-path-of-base-directory-in.html
http://magentocookbook.wordpress.com/category/magento-coding/
http://www.designer-daily.com/magento-tips-17085
http://www.learnmagento.org/page/4/
http://magebase.com/
http://www.magthemes.com/magento-blog/
http://amilan.wordpress.com/2008/05/
http://www.catgento.com/
http://spenserbaldwin.com/2010/03
http://magentoexpert.blogspot.in/2010/02/restrict-access-to-magento-during.html
http://keertikiran.blogspot.in/search/label/Magento
Free Wordpress Themes Link
http://www.freewebtemplates
http://www.freewebtemplates.com/download/free-wordpress-theme/customize-774829566/download/.com/download/free-wordpress-theme/customize-774829566/download/
http://www.freewebtemplates.com/website-templates/
http://www.freewebtemplates.com/download/free-wordpress-theme/customize-774829566/download/.com/download/free-wordpress-theme/customize-774829566/download/
http://www.freewebtemplates.com/website-templates/
Free HTML Templates link
http://www.freewebsitetemplates.com/templates/page-9
http://www.freewebtemplates.com/shop-templates/
http://www.metamorphozis.com/
http://www.templatesbox.com/templates.htm
http://www.siteground.com/
http://www.themesbase.com/?free=1&order=&page=11
http://www.freewebtemplates.com/shop-templates/
http://www.metamorphozis.com/
http://www.templatesbox.com/templates.htm
http://www.siteground.com/
http://www.themesbase.com/?free=1&order=&page=11
Subscribe to:
Posts (Atom)