SHARE
TWEET

Untitled

a guest Jun 25th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div  id="select-box1" class="select-box">
  2.     <select id="membership" tabindex="10" name="MEMBERPROG" class="custom_select caret btn form-control membership_level" data-toggle="dropdown" placeholder="Select membership level" data-bind="value:MEMBERPROG">
  3.         <option value="" selected="selected">Select membership level</option>
  4.             {foreach $membershipLevel in $searchform.membershipLevels}
  5.                 <option id="{$membershipLevel.val}" value="{$membershipLevel.val}"{if $membershipLevel.val == $searchform.MEMBERPROG} selected="selected"{/if}>{$membershipLevel.name}</option>
  6.             {/foreach}
  7.    </select>
  8. </div>
  9.      
  10. $(window).on("load", onPageLoad);
  11.  
  12. function onPageLoad() {
  13.     initListeners();
  14.     restoreSavedValues();
  15. }
  16.  
  17. function initListeners() {
  18.  
  19.     $("#membership").on("change", function() {
  20.         var value = $(this).val();
  21.         localStorage.setItem("membership", value);
  22.     });
  23.  
  24.  
  25. }
  26.  
  27. function restoreSavedValues() {
  28.  
  29.     $("#membership").on("change", function() {
  30.         var value = $(this).val();
  31.         localStorage.setItem("membership", value);
  32.     });
  33.  
  34.     // Restore other values that were previously stored here ...
  35.  
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top