Author Archives: Mika

How to Create a Countdown Timer that Refreshes the Page Daily

  <script type="text/javascript">     function getSeconds() {         var now = new Date();         var time = now.getTime();         var midnight = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);         var ft = midnight.getTime() + 86400000;         var diff [...]
Posted in JavaScript | Tagged , , , , , , , | Leave a comment

How to display fields using select drop down and jQuery

  <script type="text/javascript">     $(document).ready(function(){         $("#Select").change(function(){             if ($(this).val() == "Other" ) {                 $("#OtherField").show();             } else {                 $("#OtherField").hide();           [...]
Posted in jQuery | Tagged , , , , , , | Leave a comment

How to Show/Hide a div based on day of the week with jQuery

JavaScritpt   <script type="text/javascript">         $(document).ready(function() {                 today=new Date()         thisDay=today.getDay()                 $("#sunday").hide();                 $("#monday").hide();                 $("#tuesday").hide();       [...]
Posted in JavaScript, jQuery | Tagged , , , , , , | Leave a comment

How to change the message “No bookings found.” on Business Catalyst using JavaScript.

First wrap your module with an div like: <div id="app">{module...}</div> Then include the following JavaScript code: JavaScript     <script type="text/javascript">             $(document).ready(function() {                 var td = document.getElementById(‘app’).innerHTML;                 if(td=="No bookings found."){       [...]
Posted in Business Catalyst / GoodBarry | Tagged , , , , , | Leave a comment

How to Force Opt-In automatically instead of having to go into each contacts details – Business Catalyst

just add: &amp;Optin=True at the form action, see example below: HTML example   <form action="/FormProcessv2.aspx?WebFormID=10090&amp;OID={module_oid}&amp;OTYPE={module_otype}&amp;EID={module_eid}&amp;CID={module_cid}&amp;Optin=True" enctype="multipart/form-data" onsubmit="return checkWholeForm13472(this)" method="post" name="catwebformform13472">  
Posted in Business Catalyst / GoodBarry | Tagged , , , , , | Leave a comment

How to add a surcharge to the Amex option for the checkout form in the Online Store – Business Catalyst

Use onchange to alert the customer that a charge will occur and then the function doMath() calculates the surcharge. JavaScript   <script type="text/javascript">      function checkSel(obj) {       var ind = obj.selectedIndex;       if  (ind == 3) {           alert(‘This Card incurs a 3.5% Surcharge.’);   [...]
Posted in Business Catalyst / GoodBarry | Tagged , , , , , , , , , , | Leave a comment

How to Create a Drop Down Select with Links without a form submit.

HTML   <form action="../"> <select onchange="window.open(this.options[this.selectedIndex].value,’_top’)">     <option value="contact.html">Contact Page</option>     <option value="http://www.apple.com">Apple</option>     <option value="http://www.yahoo.com">Yahoo</option>     <option value="http://www.google.com">google</option>     <option value="about.html">About Us</option> </select> </form>   Demo Contact Page Apple Yahoo google About Us
Posted in HTML, JavaScript | Tagged , , , , , , , | Leave a comment

How to Submit Form on Selection of Dropdown Item

HTML   <select class="dropdown" id="form2" name="form2" onchange="this.form.submit();">     <option value="*">– All –</option>     <option selected="selected" value="NSW">NSW</option>     <option value="WA">WA</option>     <option value="QLD">QLD</option>     <option value="VIC">VIC</option>     <option value="ACT">ACT</option>     <option value="NT">NT</option>     <option value="NZ">NZ</option>     </select>  
Posted in HTML, JavaScript | Tagged , , , | 1 Comment

How to Automatically Re-size Images for iPhones/ iPods

CSS   @media screen and (max-device-width: 480px){     img{         max-width:100%;         height:auto;     } }  
Posted in CSS | Tagged , , , , , | 2 Comments

How to Apply CSS styles to iPhones/iPods only

CSS   @media screen and (max-device-width: 480px){     /* All iPhone only CSS goes here */ }  
Posted in CSS | Tagged , , , , , | Leave a comment