Uncategorized | October 14, 2009

Radio Buttons in CakePHP the Right Way

<?php
$options=array('Business'=>;'Business','Consumer'=>'Consumer', 'Both'=>'Both');
$attributes=array('label'=>false, 'type'=>'radio', 'value'=>'Both', 'options'=>$options);
echo $form->input('who_to_include',$attributes);
?>

Uncategorized | September 2, 2009

Converting a Tire’s Size to Wheel Height

example

265/70R17

(2*({sidewall (ex: 265)}/25.4)*({ratio (ex: 70)/100))+{wheel size (ex: 17)}

Uncategorized | July 23, 2009

Smarty crashing with JavaScript Curly Braces

If you ever need to use curly braces in a Smarty template use the following code:

{literal}
<script>// <![CDATA[
<!--
function getPrompt() {
// js function here
}
//-->
</script>
{/literal}

… or …

<script language="javascript">
<!--
function getPrompt() {ldelim}
// js function here
{rdelim}
//-->
</script>

Uncategorized | July 21, 2009

CSS Properties To JavaScript Reference Conversion

Found this uber-useful table for CSS -> Javascript conversions over at hardwar.org.  I copied it here because it was kinda buried and just in case it disappears.

CSS Property JavaScript Reference
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColor
border-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
clip clip
color color
cursor cursor
display display
filter filter
font font
font-family fontFamily
font-size fontSize
font-variant fontVariant
font-weight fontWeight
height height
left left
letter-spacing letterSpacing
line-height lineHeight
list-style listStyle
list-style-image listStyleImage
list-style-position listStylePosition
list-style-type listStyleType
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
overflow overflow
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
page-break-after pageBreakAfter
page-break-before pageBreakBefore
position position
float styleFloat
text-align textAlign
text-decoration textDecoration
text-decoration: blink textDecorationBlink
text-decoration: line-through textDecorationLineThrough
text-decoration: none textDecorationNone
text-decoration: overline textDecorationOverline
text-decoration: underline textDecorationUnderline
text-indent textIndent
text-transform textTransform
top top
vertical-align verticalAlign
visibility visibility
width width
z-index zIndex

Usage

Internet Explorer

document.all.div_id.style.JS_property_reference = “new_CSS_property_value”;

Older Netscape’s (4.7 and earlier)

document.div_id.JS_property_reference = “new_CSS_property_value”;

Netscape 6.0+ and Opera (and other Mozilla)

document.getElementById(div_id).style.JS_property_reference = “new_CSS_property_value”;

Note the use of parentheses instead of square brackets in newer Mozilla’s “getElementById()” reference.

American Crime full movie The Deer Hunter download movie Practical Magic download movie The Great Escape download movie Empire of the Sun download movie Austin Powers: International Man of Mystery download movie Charlie Bubbles download movie The Deer Hunter download movie Practical Magic download movie The Great Escape download movie Empire of the Sun download movie Austin Powers: International Man of Mystery download movie Charlie Bubbles download movie