Skip to content

Instantly share code, notes, and snippets.

@jgarber
Created May 4, 2012 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgarber/2598235 to your computer and use it in GitHub Desktop.
Save jgarber/2598235 to your computer and use it in GitHub Desktop.
ODEARGODSAVEMEFROMTHISINSANITY!!!!
<script>
function hightlightPaymentMethodLogo(payment_method_id) {
if(payment_method_id > 0) {
var payment_method_logo_id = 'payment_method_logo_' + payment_method_id;
var obj = document.getElementById(payment_method_logo_id);
obj.style['border-style'] = "solid";
obj.style['border-width'] = "2px";
obj.style['-moz-border-radius'] = "6px";
obj.style['-webkit-border-radius'] = "6px";
obj.style['border-color'] = "#00ff00";
}
}
function deHightlightPaymentMethodLogo(payment_method_id) {
if(payment_method_id > 0) {
var payment_method_logo_id = 'payment_method_logo_' + payment_method_id;
var obj = document.getElementById(payment_method_logo_id);
obj.style['border-style'] = "none";
obj.style['border-width'] = "3px";
obj.style['-moz-border-radius'] = "6px";
obj.style['-webkit-border-radius'] = "6px";
obj.style['border-color'] = "#00ff00";
}
}
</script>
<php?
$img_border = "border-style:solid;border-width:2px;-moz-border-radius: 6px;-webkit-border-radius: 6px;border-color: #00ff00;";
$logos[] = "<a onmouseover=\"this.style.cursor='pointer';hightlightPaymentMethodLogo($pm_id);\" onmouseout=\"if(document.forms[0].payment_method_id.value!=$pm_id){deHightlightPaymentMethodLogo($pm_id)};\" onclick=\"unsetErrorMsg('payment_method_id');deHightlightPaymentMethodLogo(document.forms[0].payment_method_id.value);document.forms[0].payment_method_id.value=$pm_id;hightlightPaymentMethodLogo($pm_id);totalDisplay();issuers(function(){ $('select').chosen(); });creditCard();\"><img id=\"payment_method_logo_".$pm_id."\" src=\"images/icons/$pm_logo\" width=\"40px;\" style=\"vertical-align: top;".$img_border."\" alt=\"Logo $description\"/></a>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment