Last active
December 24, 2015 10:29
-
-
Save sc0ttkclark/6784315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var custom_zip_search = '<div class="zip-search">' | |
+ '<label class="alignleft">Enter Zip:<span class="help alignright"></span></label>' | |
+ '<input type="text" name="zip_code_ZIPID" />' | |
+ '<div class="add-zip alignleft"><span class="green-arrow"></span> <span class="available">Available</span> For You To Represent.' | |
+ '<p><a href="#" class="add-another">Add another zip code for $100 annually</a></p>' | |
+ '</div></div>'; | |
$( '.checkout-2 .gfield_checkbox li' ).each( function() { | |
var $this = $( this ), | |
$checkbox = $( 'input[type="checkbox"]', $this ), | |
val = $checkbox.val(), | |
checked = $checkbox.prop( 'checked' ); | |
if ( !checked ) { | |
$this.remove(); | |
} | |
else { | |
var this_zip_search = custom_zip_search.replace( 'ZIPID', val ); | |
$this.append( this_zip_search ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment