LAYER 1 ON TOP:
<div style=”position:relative; font-size:50px; z-index:2;”>LAYER 1</div>
<div style=”position:relative; top:-50; left:5; color:red; font-size:80px; z-index:1″>LAYER 2</div>

LAYER 1
LAYER 2

LAYER 2 ON TOP:
<div style=”position:relative; font-size:50px; z-index:3;”>LAYER 1</div>
<div style=”position:relative; top:-50; left:5; color:red; font-size:80px; z-index:4″>LAYER 2</div>

LAYER 1
LAYER 2

LAYER 1
LAYER 2


Css for rounded corner

#inner { width:500px; border:3px solid #518aa4; background:#FFFFFF; padding: 2px; font: 12px Verdana, Arial, Helvetica, sans-serif; -moz-border-radius: 15px 0 15px 0; }


How could i set in php allow_call_time_pass_reference by .htaccess code

set php allow_call_time_pass_reference in .htaccess

I just spent about an hour trying to figure this out, but when you have a php application that requires call time pass reference to be enabled, you can set in the .htaccess file.

the trick is that you have to set it to “1″ and not “on” as is indicated on the PHP support forums. here’s the code:

php_flag allow_call_time_pass_reference 1


Javascript email validaion

var emailExp = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var EmailAddress = trim(document.frm.To.value);
if(trim(EmailAddress)==”") {
document.getElementById(’Error_Div’).innerHTML = “Please enter valid email id”;
document.getElementById(’Error_Div’).style.display=”block”;
document.frm.To.focus();
return false;
}

if(!EmailAddress.match(emailExp)) {
document.getElementById(’Error_Div’).innerHTML = “Please enter valid To email id”;
document.getElementById(’Error_Div’).style.display=”block”;
document.frm.To.focus();
return false;
}


Select at least one radio button

for (var i = 0; i < document.frm.TPACleared.length; i++)  {
if (document.frm.TPACleared[i].checked)  {
TPACleared_1 = document.frm.TPACleared[i].value;
TPACleared_1 = true;
}
}

if(TPACleared_1 != true){ //if found_it is NOT equal to null, a button HAS been checked
document.getElementById(’alert_div’).innerHTML= ‘Please select a option fot Response For Clearance?’;
document.getElementById(’alert_div’).style.display=’block’;
return false;
}


Javascript Trim Function

// Removes starting whitespaces
function LTrim(value) {
var re = /\s*((\S+\s*)*)/;
return value.replace(re, “$1″);
}

// Removes ending whitespaces
function RTrim(value) {
var re = /((\s*\S+)*)\s*/;
return value.replace(re, “$1″);
}

// Removes leading and ending whitespaces
function trim(value) {
return LTrim(RTrim(value));
}


JavaScript Date Validation

<!—Date Validation——————————————————————–>
/*** DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/) */
// Declaring valid date character, minimum year and maximum year
var dtCh= “-”;
var minYear=1900;
var maxYear=2100;

function isInteger(s){
var i;
for (i = 0; i < s.length; i++){
// Check that current character is number.
var c = s.charAt(i);
if (((c < “0″) || (c > “9″))) return false;
}
// All characters are numbers.
return true;
}

function stripCharsInBag(s, bag){
var i;
var returnString = “”;
// Search through string’s characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++){
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}

function daysInFebruary (year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

function DaysArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 31
if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
if (i==2) {this[i] = 29}
}
return this
}

function isDate(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var strMonth=dtStr.substring(0,pos1)
var strDay=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
strYr=strYear
if (strDay.charAt(0)==”0″ && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)==”0″ && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)==”0″ && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
//alert(”The date format should be : mm/dd/yyyy”);
document.getElementById(”alert_date_div”).innerHTML=”The date format should be : mm-dd-yyyy.”;
document.getElementById(”alert_date_div”).style.display=”block”;
//document.getElementById(”date”).focus();
return false
}
if (strMonth.length<1 || month<1 || month>12){
//alert(”Please enter a valid month”)
document.getElementById(”alert_date_div”).innerHTML=”Enter a valid month.”;
document.getElementById(”alert_date_div”).style.display=”block”;
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
//alert(”Please enter a valid day”)
document.getElementById(”alert_date_div”).innerHTML=”Enter a valid day.”;
document.getElementById(”alert_date_div”).style.display=”block”;
return false
}
if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
//alert(”Please enter a valid 4 digit year between “+minYear+” and “+maxYear)
document.getElementById(”alert_date_div”).innerHTML=”Enter a valid 4 digit year between “+minYear+” and “+maxYear;
document.getElementById(”alert_date_div”).style.display=”block”;
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
//alert(”Please enter a valid date”)
document.getElementById(”alert_date_div”).innerHTML=”Enter a valid date.”;
document.getElementById(”alert_date_div”).style.display=”block”;
return false
}
return true
}

function isDate_to_create_profile(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var strMonth=dtStr.substring(0,pos1)
var strDay=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
strYr=strYear
if (strDay.charAt(0)==”0″ && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)==”0″ && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)==”0″ && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
//alert(”The date format should be : mm/dd/yyyy”);
document.getElementById(”bprofile_baby_name_div”).innerHTML=”The date format should be : mm-dd-yyyy.”;
document.getElementById(”bprofile_baby_name_div”).style.display=”block”;
//document.getElementById(”date”).focus();
return false
}
if (strMonth.length<1 || month<1 || month>12){
//alert(”Please enter a valid month”)
document.getElementById(”bprofile_baby_name_div”).innerHTML=”Please select a valid month.”;
document.getElementById(”bprofile_baby_name_div”).style.display=”block”;
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
//alert(”Please enter a valid day”)
document.getElementById(”bprofile_baby_name_div”).innerHTML=”Please select a valid day.”;
document.getElementById(”bprofile_baby_name_div”).style.display=”block”;
return false
}
if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
//alert(”Please enter a valid 4 digit year between “+minYear+” and “+maxYear)
document.getElementById(”bprofile_baby_name_div”).innerHTML=”Please select a valid 4 digit year between “+minYear+” and “+maxYear;
document.getElementById(”bprofile_baby_name_div”).style.display=”block”;
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
//alert(”Please enter a valid date”)
document.getElementById(”bprofile_baby_name_div”).innerHTML=”Please select a valid date.”;
document.getElementById(”bprofile_baby_name_div”).style.display=”block”;
return false
}
return true
}

USE

function UserVaccinRecord(){
if( isDate( document.getElementById(’vaccin_date’).value )== false ){
return false
} else {
document.getElementById(”alert_date_div”).style.display=”none”;
}
}


JavaScript Time Validation

function IsValidTime(timeStr) {
var timePat = /^(\d{1,2}):(\d{2})(:(\d{2}))?(\s?(AM|am|PM|pm))?$/;
var matchArray = timeStr.match(timePat);
if (matchArray == null) {
return false;
}
hour = matchArray[1];
minute = matchArray[2];
second = matchArray[4];
ampm = matchArray[6];
if (second==”") { second = null; }
if (ampm==”") { ampm = null }
if (hour < 0  || hour > 23) {
return false;
}
if (hour <= 12 && ampm == null) {
return false;
}
if  (hour > 12 && ampm != null) {
return false;
}
if (minute<0 || minute > 59) {
return false;
}
if (second != null && (second < 0 || second > 59)) {
return false;
}
return true;
}

USE

function UserBirthRecord(){
if(!IsValidTime($F(’bbirthrecord_birth_time’))){
document.getElementById(’bbirthrecord_birth_weight_div’).innerHTML = “Time of Birth should be (HH:MM:SS AM/PM format).”;
document.getElementById(’bbirthrecord_birth_weight_div’).style.display=”block”;
document.getElementById(’bbirthrecord_birth_time’).focus();
return false;
} else {
document.getElementById(’bbirthrecord_birth_weight_div’).style.display=”none”;
}
}


JavaScript Trim Validation

function LTrim( value ) {
var re = /\s*((\S+\s*)*)/;
return value.replace(re, “$1″);
}

// Removes ending whitespaces
function RTrim( value ) {
var re = /((\s*\S+)*)\s*/;
return value.replace(re, “$1″);
}

// Removes leading and ending whitespaces
function trim( value ) {
return LTrim(RTrim(value));
}

USE

function ProjectValidation(){
var ProjectName = trim(document.frm.ProjectName.value);

if(ProjectName==”") {
document.getElementById(’Project_Div’).innerHTML = “Please enter project name”;
document.getElementById(’Project_Div’).style.display=”block”;
document.frm.ProjectName.focus();
return false;
}
}


Auto refresh parent window after closing popup

<script language=”JavaScript”>
<!–
function refreshParent() {
window.opener.location.href = window.opener.location.href;

if (window.opener.progressWindow)

{
window.opener.progressWindow.close()
}
window.close();
}
//–>
</script>



Next Page »