Skip to content

Instantly share code, notes, and snippets.

View cgilchrist's full-sized avatar

Carter Gilchrist cgilchrist

View GitHub Profile
@cgilchrist
cgilchrist / hint_placeholder.css
Created April 10, 2012 21:33 — forked from bitneek/Add hints to form fields
Placeholder "hint" JavaScript
<style type="text/css">
.lp-pom-form-field .hint {
color:#999999 !important; /* Grey */
}
</style>
@cgilchrist
cgilchrist / post2get_redirect.php
Created July 15, 2011 06:31
Multi-step page Redirector
<?php
// Make sure the form in your first step has a hidden field named "next_url"
// which should be the location of step 2 landing page, something like:
// "http://promos.mydomain.com/multi-step-form-2"
$redirect_to = $_POST['next_url'];
foreach($_POST as $key=>$value) {
if ($key != 'pageId' && $key != 'pageVariant' && $key != 'next_url') {
$fields_string .= $key.'='.$value.'&';
}
}
<script type="text/javascript" charset="utf-8">
window.setTimeout(function() {
parent.location = "http://unbounce.com";
}, 2000);
</script>
@cgilchrist
cgilchrist / replace_text_with_url_param.js
Created February 15, 2011 00:11
Replace some text on your page with the value of a URL parameter
<script type="text/javascript">
var getUrlParams = function() {
var params = {}, hash;
var hashes = decodeURI(window.location.href).replace(/\+/g," ").slice(window.location.href.indexOf('?') + 1).split('&');
for (var i=0; i<hashes.length; i++) {
hash = hashes[i].split('=');
params[hash[0]] = hash[1];
}
return params;
};
<link rel="stylesheet" href="http://assets.unbounce.com/m/lp-webapp/0.0.9/fancybox/jquery.fancybox-1.3.1.css" type="text/css" />
<script src="http://assets.unbounce.com/m/lp-webapp/0.0.9/fancybox/jquery.fancybox-1.3.1.js" type="text/javascript" charset="utf-8"></script>