Meta / 75% Image

Display a random image on page load using PHP

if (document.getElementById) { window.onload = swap }; function swap() { var numimages=3; rndimg = new Array("1.png", "2.png", "3.png"); x=(Math.floor(Math.random()*numimages)); randomimage=(rndimg[x]); document.getElementById("elementID").style.backgroundImage = "url("+ randomimage +")"; }

Conditionally style markup using JavaScript and CSS

Introduction Hide or show form components based on the value of a selector. //conditional-display.js //v2.2-jabbtech-llc function setDisplayed(selector, state){selector.css("display",state);} function blockDisplay(selector){setDisplayed(selector,"block");} function noneDisplay(selector){setDisplayed(selector,"none");} $(document).ready(function() { var first = $("#form-element-1"); var second = $("#form-element-2"); var third = $("#form-element-3"); var fourth = $("#form-element-4"); var selectorArray = [first,second,third,fourth];

Session variables with multipage Drupal webforms

How to create a session variable to pass between pages on a multipage Drupal webform and how to logically redirect a user based on a given value. Defining and storing a session variable: Webform Advanced Settings > Additional Processing 'x'= the component id, a number you get from the end of the URL when you edit the component. 'y'= a user defined name for the variable. Printing the variable: Form Components > Markup Note: set 'input format' to PHP code.
Subscribe to RSS - blogs