Search This Blog

Friday, December 30, 2011

Wordpress Image and javascript fetch from the folder

<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.js">

For more information checkout our official website.

Tuesday, December 20, 2011

Validation for Contact form

Select this first javascript and paste it on new javascript page and save as validation.js page. 
<script language="javascript">
function validateCompleteForm(objForm,strErrorClass){
return _validateInternal(objForm,strErrorClass,0);
};
function validateStandard(objForm,strErrorClass){
return _validateInternal(objForm,strErrorClass,1);
};
function _validateInternal(form,strErrorClass,nErrorThrowType){
var strErrorMessage="";var objFirstError=null;
if(nErrorThrowType==0){
strErrorMessage=(form.err)?form.err:_getLanguageText("err_form");
};
var fields=_GenerateFormFields(form);
for(var i=0;i<fields.length;++i){
var field=fields[i];
if(!field.IsValid(fields)){
field.SetClass(strErrorClass);
if(nErrorThrowType==1){
_throwError(field);
return false;
}else{
if(objFirstError==null){
objFirstError=field;
}
strErrorMessage=_handleError(field,strErrorMessage);
bError=true;
}
}else{
field.ResetClass();
}
};
if(objFirstError!=null){
alert(strErrorMessage);
objFirstError.element.focus();
return false;
};
return true;
};
function _getLanguageText(id){
objTextsInternal=new _jsVal_Language();
objTexts=null;
try{
objTexts=new jsVal_Language();
}catch(ignored){};
switch(id){
case "err_form":strResult=(!objTexts||!objTexts.err_form)?objTextsInternal.err_form:objTexts.err_form;break;
case "err_enter":strResult=(!objTexts||!objTexts.err_enter)?objTextsInternal.err_enter:objTexts.err_enter;break;
case "err_select":strResult=(!objTexts||!objTexts.err_select)?objTextsInternal.err_select:objTexts.err_select;break;
};
return strResult;
};
function _GenerateFormFields(form){
var arr=new Array();
for(var i=0;i<form.length;++i){
var element=form.elements[i];
var index=_getElementIndex(arr,element);
if(index==-1){
arr[arr.length]=new Field(element,form);
}else{
arr[index].Merge(element)
};
};
return arr;
};
function _getElementIndex(arr,element){
if(element.name){
var elementName=element.name.toLowerCase();
for(var i=0;i<arr.length;++i){
if(arr[i].element.name){
if(arr[i].element.name.toLowerCase()==elementName){
return i;
}
};
};
}
return -1;
};
function _jsVal_Language(){
this.err_form="Please enter/select values for the following fields:\n\n";
this.err_select="Please select a valid \"%FIELDNAME%\"";
this.err_enter="Please enter a valid \"%FIELDNAME%\"";
};
function Field(element,form){
this.type=element.type;
this.element=element;
this.exclude=element.exclude||element.getAttribute('exclude');
this.err=element.err||element.getAttribute('err');
this.required=_parseBoolean(element.required||element.getAttribute('required'));
this.realname=element.realname||element.getAttribute('realname');
this.elements=new Array();
switch(this.type){
case "textarea":
case "password":
case "text":
case "file":
this.value=element.value;
this.minLength=element.minlength||element.getAttribute('minlength');
this.maxLength=element.maxlength||element.getAttribute('maxlength');
this.regexp=this._getRegEx(element);
this.minValue=element.minvalue||element.getAttribute('minvalue');
this.maxValue=element.maxvalue||element.getAttribute('maxvalue');
this.equals=element.equals||element.getAttribute('equals');
this.callback=element.callback||element.getAttribute('callback');
break;
case "select-one":
case "select-multiple":
this.values=new Array();
for(var i=0;i<element.options.length;++i){
if(element.options[i].selected&&(!this.exclude||element.options[i].value!=this.exclude)){
this.values[this.values.length]=element.options[i].value;
}
}
this.min=element.min||element.getAttribute('min');
this.max=element.max||element.getAttribute('max');
this.equals=element.equals||element.getAttribute('equals');
break;
case "checkbox":
this.min=element.min||element.getAttribute('min');
this.max=element.max||element.getAttribute('max');
case "radio":
this.required=_parseBoolean(this.required||element.getAttribute('required'));
this.values=new Array();
if(element.checked){
this.values[0]=element.value;
}
this.elements[0]=element;
break;
};
};
Field.prototype.Merge=function(element){
var required=_parseBoolean(element.getAttribute('required'));
if(required){
this.required=true;
};
if(!this.err){
this.err=element.getAttribute('err');
};
if(!this.equals){
this.equals=element.getAttribute('equals');
};
if(!this.callback){
this.callback=element.getAttribute('callback');
};
if(!this.realname){
this.realname=element.getAttribute('realname');
};
if(!this.max){
this.max=element.getAttribute('max');
};
if(!this.min){
this.min=element.getAttribute('min');
};
if(!this.regexp){
this.regexp=this._getRegEx(element);
};
if(element.checked){
this.values[this.values.length]=element.value;
};
this.elements[this.elements.length]=element;
};
Field.prototype.IsValid=function(arrFields){
switch(this.type){
case "textarea":
case "password":
case "text":
case "file":
return this._ValidateText(arrFields);
case "select-one":
case "select-multiple":
case "radio":
case "checkbox":
return this._ValidateGroup(arrFields);
default:
return true;
};
};
Field.prototype.SetClass=function(newClassName){
if((newClassName)&&(newClassName!="")){
if((this.elements)&&(this.elements.length>0)){
for(var i=0;i<this.elements.length;++i){
if(this.elements[i].className!=newClassName){
this.elements[i].oldClassName=this.elements[i].className;
this.elements[i].className=newClassName;
}
}
}else{
if(this.element.className!=newClassName){
this.element.oldClassName=this.element.className;
this.element.className=newClassName;
}
};
}
};
Field.prototype.ResetClass=function(){
if((this.type!="button")&&(this.type!="submit")&&(this.type!="reset")){
if((this.elements)&&(this.elements.length>0)){
for(var i=0;i<this.elements.length;++i){
if(this.elements[i].oldClassName){
this.elements[i].className=this.elements[i].oldClassName;
}
else{
this.element.className="";
}
}
}else{
if(this.elements.oldClassName){
this.element.className=this.element.oldClassName;
}
else{
this.element.className="";
}
};
};
};
Field.prototype._getRegEx=function(element){
regex=element.regexp||element.getAttribute('regexp')
if(regex==null)return null;
retype=typeof(regex);
if(retype.toUpperCase()=="FUNCTION")
return regex;
else if((retype.toUpperCase()=="STRING")&&!(regex=="JSVAL_RX_EMAIL")&&!(regex=="JSVAL_RX_TEL")
&&!(regex=="JSVAL_RX_PC")&&!(regex=="JSVAL_RX_ZIP")&&!(regex=="JSVAL_RX_MONEY")
&&!(regex=="JSVAL_RX_CREDITCARD")&&!(regex=="JSVAL_RX_POSTALZIP"))
{
nBegin=0;nEnd=0;
if(regex.charAt(0)=="/")nBegin=1;
if(regex.charAt(regex.length-1)=="/")nEnd=0;
return new RegExp(regex.slice(nBegin,nEnd));
}
else{
return regex;
};
};
Field.prototype._ValidateText=function(arrFields){
if((this.required)&&(this.callback)){
nCurId=this.element.id?this.element.id:"";
nCurName=this.element.name?this.element.name:"";
eval("bResult = "+this.callback+"('"+nCurId+"', '"+nCurName+"', '"+this.value+"');");
if(bResult==false){
return false;
};
}else{
if(this.required&&!this.value){
return false;
};
if(this.value&&(this.minLength&&this.value.length<this.minLength)){
return false;
};
if(this.value&&(this.maxLength&&this.value.length>this.maxLength)){
return false;
};
if(this.regexp){
if(!_checkRegExp(this.regexp,this.value))
{
if(!this.required&&this.value){
return false;
}
if(this.required){
return false;
}
}
else
{
return true;
};
};
if(this.equals){
for(var i=0;i<arrFields.length;++i){
var field=arrFields[i];
if((field.element.name==this.equals)||(field.element.id==this.equals)){
if(field.element.value!=this.value){
return false;
};
break;
};
};
};
if(this.required){
var fValue=parseFloat(this.value);
if((this.minValue||this.maxValue)&&isNaN(fValue)){
return false;
};
if((this.minValue)&&(fValue<this.minValue)){
return false;
};
if((this.maxValue)&&(fValue>this.maxValue)){
return false
};
};
}
return true;
};
Field.prototype._ValidateGroup=function(arrFields){
if(this.required&&this.values.length==0){
return false;
};
if(this.required&&this.min&&this.min>this.values.length){
return false;
};
if(this.required&&this.max&&this.max<this.values.length){
return false;
};
return true;
};
function _handleError(field,strErrorMessage){
var obj=field.element;
strNewMessage=strErrorMessage+((field.realname)?field.realname:((obj.id)?obj.id:obj.name))+"\n";
return strNewMessage;
};
function _throwError(field){
var obj=field.element;
switch(field.type){
case "text":
case "password":
case "textarea":
case "file":
alert(_getError(field,"err_enter"));
try{
obj.focus();
}
catch(ignore){}
break;
case "select-one":
case "select-multiple":
case "radio":
case "checkbox":
alert(_getError(field,"err_select"));
break;
};
};
function _getError(field,str){
var obj=field.element;
strErrorTemp=(field.err)?field.err:_getLanguageText(str);
idx=strErrorTemp.indexOf("\\n");
while(idx>-1){
strErrorTemp=strErrorTemp.replace("\\n","\n");
idx=strErrorTemp.indexOf("\\n");
};
return strErrorTemp.replace("%FIELDNAME%",(field.realname)?field.realname:((obj.id)?obj.id:obj.name));
};
function _parseBoolean(value){
return !(!value||value==0||value=="0"||value=="false");
};
function _checkRegExp(regx,value){
switch(regx){
case "JSVAL_RX_EMAIL":
return((/^[0-9a-zA-ZüöäßÄÖÜ]+([\.-]?[0-9a-zA-ZüöäßÄÖÜ]+)*@[a-zA-ZüöäßÄÖÜ]+([\.-]?[a-zA-ZüöäßÄÖÜ]+)*(\.\w{2,5})+$/).test(value));
case "JSVAL_RX_TEL":
return((/^1?[\-]?\(?\d{3}\)?[\-]?\d{3}[\-]?\d{4}$/).test(value));
case "JSVAL_RX_PC":
return((/^[a-z]\d[a-z]?\d[a-z]\d$/i).test(value));
case "JSVAL_RX_ZIP":
return((/^\d{5}$/).test(value));
case "JSVAL_RX_MONEY":
return((/^\d+([\.]\d\d)?$/).test(value));
case "JSVAL_RX_CREDITCARD":
return(!isNaN(value));
case "JSVAL_RX_POSTALZIP":
if(value.length==6||value.length==7)
return((/^[a-zA-Z]\d[a-zA-Z] ?\d[a-zA-Z]\d$/).test(value));
if(value.length==5||value.length==10)
return((/^\d{5}(\-\d{4})?$/).test(value));
break;
default:
return(regx.test(value));
};
};
 </script>


Copy this javascript and paste it on the perticular page where you need to validate form.
also change the  name of form in the bracket. here it is used as a contact form for example.

<script language="javascript">
    <!--
        function initValidation()
        {
            var objForm = document.forms["contact form"];
            objForm.name.required = 1;
            objForm.name.regexp =/\w*$/;

            objForm.phone.required = 1;
            objForm.phone.required = 1;
            objForm.phone.regexp = /^\d+([\.]\d\d)?$/;

            objForm.email.required = 1;
            objForm.email.regexp = "JSVAL_RX_EMAIL";
        }
    //-->
    </script>

put this onload function in the body tag.

<body onLoad="initValidation()">

give the javascipt line to your form which is on submit line.
<form name="contact form" method="post" onSubmit="return validateCompleteForm(this, 'error');" action="mineral-water-form.php#mineral-water-form">

For more information checkout our official website.
Hire Web designer

Wednesday, November 23, 2011

Friday, September 30, 2011

Online Chat for skype, google talk, MSN, yahoo messenger

YAHOO




MSN





SKYPE





GOOGLE TALK






 

<p>
<span class="lc-bold-txt">YAHOO</span>
<span class="lc-img">
<a href="ymsgr:sendIM?shreejiinfotek"><img src="http://a1.idata.over-blog.com/100x100/2/88/70/07/Talk-to-me-Icons/yahoo-messenger-icon.png" width="100" height="100"></a>
</span>
</p>
<p>
<span class="lc-bold-txt">MSN</span>
<span class="lc-img">
<a href="msnim:add?shreejiinfotek"><img src="https://www.copacabanapoker.com/en/images/iconMSN.png" width="100" height="100"></a>
</span>
</p>

<p>
<span class="lc-bold-txt">SKYPE</span>
<span class="lc-img">
<a href="skype:shreejiinfotek?chat"><img src="http://www.learnosity.com/wsimages/ui/skype-icon.png" width="100" height="100"></a>
</span>
</p>

<p>
<span class="lc-bold-txt">GOOGLE TALK</span>
<span class="lc-img">
<a href="gtalk:chat?jid=shreejiinfotek"><img src="http://www.madblueinc.com/wp-content/themes/LightFolio/images/icon_gtalk.png" width="100" height="100"></a>
</span>
</p>

For more information checkout our official website.
Hire Web designer

Tuesday, September 6, 2011

Very Simple Lightbox Effect Well working

in the top of head put the style code.

<style>
        .black_overlay{
            display: none;
            position: fixed;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color: black;
            z-index:1001;
            -moz-opacity: 0.8;
            opacity:.80;
            filter: alpha(opacity=80);
        }
        .white_content {
            display: none;
            position: fixed;
            top: 2%;
            left: 25%;
            width: 50%;
            height: 85%;
            padding: 16px;
            border: 16px solid orange;
            background-color: white;
            z-index:1002;
            overflow: auto;
        }
    </style>

Paste the below code to a href tag.

<a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"><img src="images1.jpg" alt="image" border="0" class="product-image-border" /></a>

Put this code after a href tag. this div contains the content you want to show in lightbox.

<div id="light" class="white_content"><img src="images/2/large/1.jpg" alt="image" border="0" /><a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a></div>
        <div id="fade" class="black_overlay"></div>

For more information checkout our official website.
Hire Web designer







Sunday, August 7, 2011

Download Database DATA From HTML to EXCEL File.. Best Working

For work with this code just copy this code and put it at the page which you want to download. its catch all the data of the page.. 

<?php
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=filename.xls");
header("Pragma: no-cache");
header("Expires: 0");
?>

Best Working and Helpful code for PHP Coders...

For more information checkout our official website.
Hire Web designer

Saturday, August 6, 2011

Link to new page in Dropdown menu Best Working

<form action="../"> <select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
                                        <option value="">Please Select Product</option>
                                        <option value="http://www.shreejiinfotek.com" style="font-weight: bold;">nirav panchal</option>
                                            <option value="http://www.shreejiinfotek.com">nirav panchal </option>
                                    </select>
                                </form>

Search image by its name Very Best Working

<script language=JavaScript1.1>
  
  
    // ************************* pre-cache five actor pictures
  
    image1 = new Image()
    image1.src = "images/1/1.jpg"
    image2 = new Image()
    image2.src = "images/1/2.jpg"
    image3 = new Image()
    image3.src = "images/1/3.jpg"
    image4 = new Image()
    image4.src = "images/1/4.jpg"
  
    function Bond_pictures(list) {
  
    /*List is an object and not a variable. The code below turns
    it into a variable.*/
  
    var img = list.options[list.selectedIndex].value;
  
    //list.selectedIndex can go from 1 to 5.
  
    document.bond_frame.src = eval(img + ".src");
  
    }
    </script>

<div class="search-area" align="right">
<form>
Search Model Number  <select onchange=Bond_pictures(this) name=cached>
<option onclick="showHide(1);" selected>Please Select
<option value=image1 onclick="showHide(1);">Totalizers
<option value=image2 onclick="showHide(1);">Preset Counters
<option value=image3 onclick="showHide(1);">Digital Panel
Meters
<option value=image4 onclick="showHide(1);">Special Function
Controls
</OPTION>
</SELECT>
</FORM>
</div>
<div>
<img src="images/1.jpg" width=136 name=bond_frame>
</div>

Tuesday, July 19, 2011

Display Current Time

<script language="Javascript">
setInterval("settime()", 1000);

function settime () {
  var curtime = new Date();
  var curhour = curtime.getHours();
  var curmin = curtime.getMinutes();
  var cursec = curtime.getSeconds();
  var time = "";

  if(curhour == 0) curhour = 12;
  time = (curhour > 12 ? curhour - 12 : curhour) + ":" +
         (curmin < 10 ? "0" : "") + curmin + ":" +
         (cursec < 10 ? "0" : "") + cursec + " " +
         (curhour > 12 ? "PM" : "AM");

  document.date.clock.value = time;
}
</script>


<html>
<body>

<form name="date">
                <input type="text" name="clock" style="border: 0px" value="" class="textbox-time">
            </form>

</body>
</html>

Monday, February 14, 2011

Joomla Template Integration = Very Important

Steps for joomla integration of your own design.

(1) copy any joomla template and make its copy. and rename the original one with ur own project name..

(2) put your whole main div code to the index.php of the perticular template.

(3) make its own default module.. each module for each section...

(4) in joomla administrator module go to module manager and click on new.

(5) select custom HTML.

(6)give the title enable it, put the position which is described on your own module in php file for example

<jdoc:include type="modules" name="home_banner" />

(7) put ur html code in html area... and thats it...

(8) put ur all images in to ur template images folder as well joomla main images folder also...

(9) put css in css folder of template.

(10) main middle area or content area is work dynamically so put that code separate with the code

<jdoc:include type="component" />

(11) this component is in the component folder work with dashboard area....

components\com_dashboard\views\dashboard\tmpl

u must need to change ur data as per ur requirement....

(12) put this code on the top of ur index.php for error message display..

<jdoc:include type="message" />

Thursday, February 10, 2011

ERROR message == Displays very good design for Error Message

Copy this code to your CSS.... and use as individual as defined....
.success {
  color: #4F8A10;
  background-color: #DFF2BF;  border: 1px solid;
 
  /*------ for error  -------*/

  color: #D8000C;
  background-color: #FFBABA;  border: 1px solid;
 
  /*------ for warning  -------*/
  color: #9F6000;
  background-color: #FEEFB3;  border: 1px solid;
 
  margin: 10px 0px;
  padding:15px 10px 15px 20px;
  background-repeat: no-repeat;
  background-position: 10px center;
}

this is for span which is used for  image set in HTML
.error span { margin: 0px 0px 0px 10px; font-family:calibari, arial; font-size: 14px; padding: 0px; vertical-align:top; line-height: 35px;}

Copy This CODE to your HTML  also use with individual classes as defined in CSS.

<div class="error"><img src="image/error.png" alt="error" border="0" align="top" /> <span>Enter correct Username or Password</span></div>

Font Face Working in All Browsers.... Must use it.... By Jasmin Kanani...

Put this code to your <head> Section of youor HTML page.

<!--[if IE]>
    <link rel="stylesheet" type="text/css" href="css/ie.css" />
<![endif]-->

Create NEW CSS named ie.css and put the below code to that CSS and make sure the font extention must be .eot for internet Explorer.

@font-face {
    font-family: erasdust;
    src: url('../font/ERASDUST.eot');   
}

And for other Browsers put the below code to the your main CSS

@font-face {
    font-family: erasdust;
    src: url('../font/ERASDUST.TTF');   
}

Note: Don't forget to make folder for fonts and put the fonts in that folder only....

Wednesday, February 9, 2011

Contact form code very easy

<?php


if(isset($_POST['submit']))
    {
   
       
           
           
            $email='niravpanchal29@gmail.com';
            $subject ="Contact from your site name" ;
            $body = "<table>";
            $body .= "<tr><td>Name </td><td>:- ".$_POST['first_name']." ".$_POST['last_name']."</td></tr>";
            $body .= "<tr><td>Phone </td><td>:- ".$_POST['phone']."</td></tr>";
            $body .= "<tr><td>Alt Phone </td><td>:- ".$_POST['altphone']."</td></tr>";
            $body .= "<tr><td>Zip</td><td>:- ".$_POST['zip']."</td></tr>";
            $body .= "<tr><td>HomeOwner?</td><td>:- ".$_POST['HomeOwner']."</td></tr>";
            $body .= "</table>";
                       
            $headers  = 'MIME-Version: 1.0' . "\r\n";
            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
            $headers .= 'From:niravpanchal29@gmail.com  <niravpanchal29@gmail.com>' . "\r\n";
            mail($email, $subject, $body, $headers);
           
           
            echo '<script>    window.location="thankyou.html"
                            </script>';
                           
           
       
    }

?>


And put this code in thank you.html page

  <script type="text/JavaScript">
setTimeout("location.href = 'index.php';",5000);
  </script>
</head>

<body>
<div align="center">
<p
 style="color: rgb(102, 102, 102); font-weight: bold; font-size: large;">Thank
you
very much for contacting us. <br>
We will be in touch with you soon. </p>
</div>

Javascript for onover image and content change best working

<script type="text/javascript">
function inlarge_image(img)

{
    document.getElementById('text_1').style.display='none';
    document.getElementById('text_2').style.display='none';
    document.getElementById('text_3').style.display='none';
    document.getElementById('text_4').style.display='none';
    document.getElementById('text_5').style.display='none';
    document.getElementById('text_6').style.display='none';
    document.getElementById('large_image').src='images/big_image'+img+'.png';
    document.getElementById('text_'+img).style.display='block';
   

}
</script>

</head>

<body>

<div align="center"><img src="images/big_image1.png" id="large_image" alt="image" border="0" /></div>
<div id="text_1">
    Der Superwächter
</div>
    <a href="#"><img src="images/image.png" onmouseover="inlarge_image(1);" alt="image" border="0" /></a>
</body>
</html>