Friday, 24 August 2007

HTML: Mailto with CC, Subject, Body prepopulated

<a href="mailto:your.nominateduser@yahoo.com.au?cc=your.nominateduser@yahoo.com.au&subject=A new request&body=Please kindly complete the details below:%0D%0A%0D%0AName:%0D%0ATitle:%0D%0ALocation:%0D%0APhone:%0D%0AMobile:%0D%0A">Click here to email</a>

Wednesday, 15 August 2007

Javascript: Replacing OnLoad attribute in Body tag

//This section runs the SetPage function when the form loads - replaces OnLoad function in body tag
addLoadEvent(SetPage);
function addLoadEvent(func) {   
   var oldonload = window.onload;   
   if (typeof window.onload != 'function') {   
     window.onload = func;   
   } else {   
     window.onload = function() {   
       oldonload();   
       func();   
     }   
  }   
}

//Another example will run when page load but code doesn't utilize onLoad attribute in body tag
var frm = document.frmCreateModifyPosition;
window.onload = function(){
if (frm.txtAction[1].checked){
ShowPositionID()
}
}