Populate text area with values from custom attributes in dropdown

jQuery(document).ready(function($){ //this populates the readonly text area with the event details jQuery(‘#input_1_1’).change(function(){ var datetime = $(‘option:selected’, this).attr(‘datetime’); var venue = $(‘option:selected’, this).attr(‘venue’); var address = $(‘option:selected’, this).attr(‘address’); var city = $(‘option:selected’, this).attr(‘city’); var state = $(‘option:selected’, this).attr(‘state’); var zip = $(‘option:selected’, this).attr(‘zip’); jQuery(‘#input_1_2’).val( datetime + “\n”+ venue + “\n”+ address + “\n” + city + Read More…

Populate hidden text input with custom attributes from radio button

jQuery(document).ready(function($){ //this populates the hidden text inputs with the event details jQuery(‘#input_2_1’).change(function(){ var datetime = jQuery(‘input[name=”input_1″]:checked’, this).attr(‘datetime’); var venue = jQuery(‘input[name=”input_1″]:checked’, this).attr(‘venue’); var address = jQuery(‘input[name=”input_1″]:checked’, this).attr(‘address’); var city = jQuery(‘input[name=”input_1″]:checked’, this).attr(‘city’); var state = jQuery(‘input[name=”input_1″]:checked’, this).attr(‘state’); var zip = jQuery(‘input[name=”input_1″]:checked’, this).attr(‘zip’); jQuery(‘#input_2_11’).val( datetime ); jQuery(‘#input_2_12’).val( venue ); jQuery(‘#input_2_13’).val( address ); jQuery(‘#input_2_14’).val( city ); jQuery(‘#input_2_15’).val( Read More…

Pre populate Hidden input from Radio Button Label

This is a jQuery snippet that will populate an input field with the html from a radio button label   ///////////////////////////////////////////// // Get the html from the selected Event on the radio button and put it in the hidden field so we can access it in the pdf for the ticket ///////////////////////////////////////////// $(‘#input_1_1’).click(function(){ var selectedEvent Read More…

Google Analytics Async Event Tracking

Trying to figure out how to get event tracking working with the new async (analytics.js) code was a pain. Googles documentation for anything to do with analytics is always confusing. <script> (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’); ga(‘create’, ‘UA-XXX-X’, ‘example.com’); ga(‘send’, ‘pageview’); //here is the code that actually worked. You put it in the script area Read More…

Radio button .selected class when chosen

Use this code in your custom .js file to add a .selected class to the parent of the selected radio button   //add class .selected to the parent of the radio button checked in gravity forms. $(‘input:radio’).click(function() { $(‘input:radio[name=’+$(this).attr(‘name’)+’]’).parent().removeClass(‘selected’); $(this).parent().addClass(‘selected’); });

Use Select Dropdown as menu

Paste this code into your custom .js file to use a dropdown to navigate to different pages. // select dropdown for mobile $(“ul.accordion select”).change(function() { window.location = $(this).find(“option:selected”).val(); }); The Option in the Select dropdown looks like this: <option value=”/alabama-liens”>Alabama (41)</option> In this case when it is selected it will navigate to /alabama-liens in the Read More…