Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@victorzen
victorzen / Align text inside button.md
Last active December 1, 2015 04:18
Align text inside button

Change "#lp-pom-button-21" for your button's id and change "left" for "right" accordingly.

<style>
#lp-pom-button-21 .label{
  text-align: left;
}
</style>
@victorzen
victorzen / Multi-language Datepicker.md
Last active April 16, 2016 00:57
Translate Datepicker to any language.

Change "YourFieldName" for the field name in your form and change the information to your own language and prefered date format. This example is in French :) Set placement to "Head"

<script>
$(function() {
$( "#YourFieldName").datepicker({
    altField: "#datepicker",
    closeText: 'Fermer',
    prevText: 'Précédent',
    nextText: 'Suivant',
 currentText: 'Aujourd\'hui',
@victorzen
victorzen / Font inside form fields.md
Last active April 16, 2016 01:30
Change the font inside form fields.
<style>
.lp-pom-form-field input {
   font-family: 'Comic Sans MS' !important;
}
</style>
@victorzen
victorzen / Floating Labels.md
Last active August 17, 2017 17:58
Floating field labels
@victorzen
victorzen / Max number of characters in a field.md
Last active April 16, 2016 01:00
Limit the number of characters allowed in a form field.

Some services that integrate with Unbounce impose a maximum number of characters, including spaces, that you can add into a field.

For example MailChimp, Campaign Monitor, Constant Contact and Zoho CRM allow a maximum number of around 250 characters, while other services like AWeber have a limit of between 16 to 33, depending on the type of characters.

In order to avoid integration errors, you can limit the amount of characters allowed in your form fields by adding the following script to the Javascripts section of your page, selecting "Before Body End Tag" as the placement:

<script> 
$(document).ready(function(){

//Change 'email' for the ID of your form field and '10' for the max number of characters allowed. 
@victorzen
victorzen / Phone field format.md
Last active March 31, 2017 21:02
Give phone numbers any format in the form field

Paste the following script in the Javascripts section of the page selecting 'Before Body End Tag' as the placement. You can change the mask to any phone number format you want:

<script src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.1.62/jquery.inputmask.bundle.js"></script>

<script>
/**
    * Do not remove this section; it allows our team to troubleshoot and track feature adoption. 
 * TS:0002-08-073
@victorzen
victorzen / Error message disappears.md
Last active October 17, 2016 18:21
Error message disappears when clicked or after a few seconds

Paste the following code in the Javascripts section of your page selecting 'Before Body End Tag' as the placement:

<script>
  $(function(){
    $(".lp-form-errors").click(function(){
      $(".lp-form-errors").fadeOut()
    }); 
    $('.lp-pom-form .lp-pom-button').click(function(){
 
@victorzen
victorzen / Element appears on timer.md
Last active June 17, 2016 20:06
Make element appear on timer.

Change '#lp-pom-block-10' for the ID of the element you want to hide and make re-appear in both the javascript and the CSS. You can add multiple elements separating them by a comma ('#lp-pom-block-10, #lp-pom-button-75'). Change 5000 to adjust the timer, time is in milliseconds.

Javascript:

<script>
window.setTimeout(function () {
  $('#lp-pom-block-10').show();
  }, 5000);
@victorzen
victorzen / Flexible Form Fields.md
Last active April 22, 2021 14:05
Allows you to place form fields anywhere on the page
<script>
/**
    * Do not remove this section; it allows our team to troubleshoot and track feature adoption. 
    * TS:0002-08-042
*/
  lp.jQuery(document).ready(function($) {
    
    //Change #lp-pom-box-01, etc. for the IDs of the boxes where you want the form fields to display.
 var boxes = ["#lp-pom-box-01",
@victorzen
victorzen / Dropdown menu text color change.md
Last active May 8, 2017 18:08
Text color in dropdown menu matches text color in placeholders and turns black when selection is made.

Javascript:

<script>
   lp.jQuery(document).ready(function($) {  
      $("select").addClass("notselected");       
      $("select").live('change', function() {
         $("select").removeClass("notselected")
      });
   });