Subsribe to our RSS

latest reactions

christian louboutin shoes
With that kind of traffic you want to ad …
Rahul Anand
Thanks for the nice post. It works for m …
Serkan
thx a lot! …
msb
Thanks for above solution.There is ano …
Lori S.
FYI, I was using this successfully in CF …

Use OpenDNS

mxna feeds

Interview with ProGit Author, Scott ChaconColdFusion 9 Developer TutorialColdFusion MeetUp: Digging Into The Developer Toolbox, with Jim PriestColdFusion MeetUp: Using jQuery as a Proxy to ColdFusion, with Hal HelmsColdFusion Job Opportunity in Lexington, MAColdFusion Job Opportunity in Washington, DCColdFusion Job Opportunity in Rye, NYConfiguring Apache To Use Multiple Versions of ColdFusionFun with Decentralised Version ControlEscaping Form Values - Understanding The ColdFusion htmlEditFormat() Life CycleColdFusion Job Opportunity in Limburg, BelgiumColdFusion Job Opportunity in Colchester, Suffolk, United KingdomColdFusion Job Opportunity in Houston, TXUpdate to my 911 ViewerColdFusion Job Opportunity in Chico, CA

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2010 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos Gallupa

Awesome feature in Mootools 1.3..

As you may (or may not) know, I use the Mootools framework in CFCDoc. And in a whole lot of other things as a matter of fact.

Upon browsing through Mootools wiki, I came across an interesting feature planned for version 1.3.   Check out that last one. (click image to zoom)



5578 viewed | 1 opinion(s)  | del.icio.us | Digg it | Jax @ 10:05 cet


initCap for JavaScript

Just posting this to have it in my code snippets :-) Javascript function to capitalize the first letter of a phrase or word....

<script type="text/javascript">
function initCap(str) {
 /* First letter as uppercase, rest lower */
 var str = str.substring(0,1).toUpperCase() + str.substring(1,str.length).toLowerCase();

 return str;
}
</script>

<input type="text" value="chANGE this PHrase!" name="field1">
<input type="button" onclick="alert(initCap(field1.value))" value="Test initCap">

5083 viewed | 3 opinion(s)  | del.icio.us | Digg it | Tjarko @ 11:31 cet

Trim javascript function

function trim(str) {
  str = str.replace( /^\s+/g, "" ); // strip leading
  str = str.replace( /\s+$/g, "" ); // strip trailing

  return str;
}

UPDATE: This is a Javascript function that I use to strip values. In ColdFusion you can use the standard trim() function.

<cfset var = trim(variables.x)>

or ltrim (left) / rtrim (right) functions

9367 viewed | 3 opinion(s)  | del.icio.us | Digg it | Tjarko @ 10:05 cet

Setting the focus on the first form element available

<script language="javascript" type="text/javascript">
 function setFocus(aForm){
  if( aForm.elements[0]!=null) {
   var i;
   var max = aForm.length;
   for( i = 0; i < max; i++ ) {
    if( aForm.elements[ i ].type != "hidden"
     && !aForm.elements[ i ].disabled
     && !aForm.elements[ i ].readOnly ) {
      aForm.elements[ i ].focus();
      break;
     }
   }
  }
 }
</script>

<body onLoad="setFocus(document.forms[0])"></body>

4777 viewed | Your opinion...  | del.icio.us | Digg it | Tjarko @ 9:45 cet