Skip to content

Instantly share code, notes, and snippets.

input[type="submit"]::-moz-focus-inner {
margin-top:1px;
margin-bottom: 2px;
}
@joemeador
joemeador / jQuery Step 2
Created March 28, 2014 19:09
Form autofill city and state fields
jQuery('#field_65185').keyup(function () { //the meat of this was inspired by css-tricks.com
var el = jQuery(this);
if (jQuery('#field_65185').val().length === 5) {
jQuery.ajax({
url: 'http://zip.elevenbasetwo.com/v2/US/' + el.val(),
cache: false,
dataType: 'json',
type: 'GET',
@joemeador
joemeador / jQuery Step 1
Last active August 29, 2015 13:57
Form autofill city and state
jQuery('.cat-request .info_block.city').hide();
jQuery('.cat-request .info_block.state').hide();
jQuery('.cat-request .field_error').hide();
jQuery('#bronto select').change(function () {
jQuery('.cat-request .info_block.city').slideDown(); /* Show the fields */
jQuery('.cat-request .info_block.state').slideDown(); /* Show the fields */
jQuery('.field_error').remove();
jQuery(document).ajaxStop(function() {
jQuery('.cat-request .info_block.city input').val('');
@joemeador
joemeador / Form HTML
Last active June 7, 2022 23:28
Form city and state autofill html
<form id="bronto" class="span12 cat-request" action="http://app.bronto.com/public/webform/process/" method="post" target="_parent">
<div id="row_3781" class="section">
<div style="clear: both;">&nbsp;</div>
</div>
<div style="clear: both;">&nbsp;</div>
<div class="info_block first">
<div class="block">
<input id="field_63353" class="text field" type="text" name="11341[63353]" value="" size="47" autocomplete="off" required="">
<label for="field_63353">First Name</label>
</div>
<resources>
<db>
<table_prefix><![CDATA[]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[your database username]]></username>
<password><![CDATA[your database password]]></password>
<dbname><![CDATA[your database name]]></dbname>
@joemeador
joemeador / Custom CSS for Magento accordion layered navigation
Created February 10, 2014 00:53
Show down arrow when .expanded is applied
#narrow-by-list .expanded{
background: url(../images/arrow-down.png);
background-position:9px 11px;
background-repeat:no-repeat;
}
@joemeador
joemeador / Magento jQuery function for accordion style layered navigation
Last active July 17, 2016 13:19
jQuery function to toggle Magento layered navigation attributes. Change .slice(1) to how many lists you want displayed by default.
jQuery(document).ready(function(){
// Adds open and close option for sidebar filters
jQuery('#narrow-by-list > dt:first').addClass('expanded');
jQuery('dl#narrow-by-list > dd').slice(1).hide();
jQuery('dl#narrow-by-list > dt a').click(function(){
jQuery(this).parent().next().slideToggle('slow');
jQuery(this).parent().toggleClass('expanded');
return false;
});
<dt><a href="#"><?php echo $this->__($_filter->getName()) ?></a></dt>
<dt><?php echo $this->__($_filter->getName()) ?></dt>
<?php if($this->canShowBlock()): ?>
<div class="block block-layered-nav">
<div class="block-title">
<strong><span><?php echo $this->__('Shop By') ?></span></strong>
</div>
<div class="block-content">
<?php echo $this->getStateHtml() ?>
<?php if ($this->getLayer()->getState()->getFilters()): ?>
<div class="actions"><a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div>
<?php endif; ?>