Skip to content

Instantly share code, notes, and snippets.

View longjasonm's full-sized avatar

Jason Long longjasonm

View GitHub Profile
@longjasonm
longjasonm / gist:4516601
Last active December 11, 2015 00:28
A Force.com Validation Trigger to verify that all of the BANT fields are filled in before a lead can be saved as a TQL.
ISPICKVAL(Lead_Contact_Status__c, "TQL")
&&
OR (
ISPICKVAL( Budget__c,"" ),
ISPICKVAL( Need__c,"" ),
ISPICKVAL( Authority__c,"" ),
ISPICKVAL( Timing__c,"" )
)
@longjasonm
longjasonm / gist:4586504
Created January 21, 2013 14:36
Make Marketo iFrame form "bust out" to the Parent frame.
<script type="text/javascript" language="javascript">
//uses standard Marketo jQuery variable; if you have defined another variable, use it for "$jQ" instead.
$jQ(document).ready(function(){
$jQ('.lpeRegForm').attr('target','_top');
});
</script>
@longjasonm
longjasonm / gist:4658095
Created January 28, 2013 19:01
Shortest way to print current year in Javascript; for use in web pages footers. Source: http://stackoverflow.com/questions/4562587/shortest-way-to-print-current-year-in-javascript
<script>document.write(new Date().getFullYear())</script>
<!-- Example Code -->
<span>&copy; 2000&ndash;<script>document.write(new Date().getFullYear())</script> Your Company Name</span>
@longjasonm
longjasonm / gist:4711941
Created February 5, 2013 03:32
Make a Marketo iframe form "bust out" to the parent frame
$jQuery(document).ready(function(){
$jQ('.lpeRegForm').attr('target','_top');
});
@longjasonm
longjasonm / gist:5033215
Created February 25, 2013 20:56
Show/hide fields dynamically on Marketo forms.
<script type="text/javascript">
var $jQ = jQuery.noConflict();
$jQ(document).ready(function(){
//This code shows a field with ID = "State" when the value of field ID = "Country" is "Australia".
//Add this code to an HTML block on the landing page.
// Put the ID of the dynamic field here
var stateRow = $jQ("#State").parents("li:first");
var stateField = $jQ("#State");
@longjasonm
longjasonm / gist:5334717
Last active December 15, 2015 22:39
Change Submit Button text on a Marketo Landing Page Form
<script type="text/javascript">
// Add this code in a "HTML" block in the Marketo Landing Page Editor.
// Use jQuery.noConflict just in case.
if ( typeof $jQ == 'undefined' ) { var $jQ = jQuery.noConflict(); }
// Declare your Submit Button Text; example: .val('Register for Webinar')
$jQ(document).ready(function() {
$jQ('#mktFrmSubmit').val('... your text here...');
})
@longjasonm
longjasonm / functions.php
Last active November 6, 2019 00:40
How to set up a 4-column footer in the Genesis framework. I've only seen code about 3-column setups, but I need 4 for a design I'm working on. Here's my code.
<?php
//* Do NOT include the opening php tag
// Add support for 4-column footer widgets
add_theme_support( 'genesis-footer-widgets', 4 );
@longjasonm
longjasonm / gist:6529893
Created September 11, 2013 21:15
Make all links on a page "nofollow".
<script type="text/javascript">
if ( typeof $jQ == 'undefined' ) { var $jQ = jQuery.noConflict(); }
$jQ(document).ready(function() {
$jQ('a').attr('rel', 'nofollow');
})
</script>
@longjasonm
longjasonm / gist:6555757
Created September 13, 2013 20:38
Update the intro text on the Marketo Social Sign-In box.
<script type="text/javascript">
// Add this code in a "HTML" block in the Marketo Landing Page Editor.
// Use jQuery.noConflict just in case.
if ( typeof $jQ == 'undefined' ) { var $jQ = jQuery.noConflict(); }
//Replace 'Register with:" with your desired text.
$jQ(document).ready(function() {
$jQ('.cf_sign_on_caption').html('Register with:');
})
@longjasonm
longjasonm / checkbox-validate.js
Created November 12, 2013 17:56
Validate a Marketo Terms and Conditions (or any other) Checkbox
//Add the ID of your Marketo Form
$('#mktForm_1030').attr('onSubmit','return validate_form ( );');
//Add the "name" properties of your form and field. i.e. mktForm_1030, CustomField_Terms_of_Service)
function validate_form ( )
{
valid = true;