pipidodo

Calorie Calculator /js/calcactions.js

Jun 23rd, 2021
818
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ACTIVITIES SELECT PULDOWN BOX
  2.     var xx = 0;
  3.     var ch = "A";
  4.     document.write('<optgroup label="' + ch + '">');
  5.     while (Actions[xx]){
  6.         if ((Actions[xx].charAt(0)).toUpperCase() != ch){
  7.             ch = (Actions[xx].charAt(0)).toUpperCase();
  8.             document.write('</optgroup>');
  9.             document.write('<optgroup label="' + ch + '">');
  10.         }  
  11.     document.write('<option value="' + xx + '">' + Actions[xx] + '</option>');
  12.       xx += 2;
  13.     }
  14.     document.write('</optgroup></select>');
  15. // START TIME SELECT   
  16.     document.write('<table><tr><td style="width:28%">');
  17.     document.write('<fieldset class="fibl"><legend>Started at:</legend>');
  18.     document.write('<select id="starth" onchange="eattime(\'starth\')" class="fiel" style="align:center; text-align:center; background-color:#e9ffe8">');
  19.     writeh('#e9ffe8');
  20.     document.write('</select> H. ');    
  21.     document.write('<select id="startm" onchange="eattime(\'startm\')" class="fiel" style="align:center; text-align:center; background-color:#e9ffe8">');
  22.     writem('#e9ffe8');
  23.     document.write('</select> M.');        
  24.     document.write('</fieldset>');
  25. // DURATION SELECT 
  26.     document.write('</td><td  style="width:28%">');
  27.     document.write('<fieldset class="fibl"><legend>Duration:</legend>');
  28.     document.write('<select id="durh" onchange="eattime(\'durh\')" class="fiel" style="align:center; text-align:center; background-color:#e9ffe8">');
  29.     writeh('#e9ffe8');
  30.     document.write('</select> H. ');    
  31.     document.write('<select id="durm" onchange="eattime(\'durm\')" class="fiel" style="align:center; text-align:center; background-color:#e9ffe8">');
  32.     writem('#e9ffe8');
  33.     document.write('</select> M.');        
  34.     document.write('</fieldset></td><td width="24%"><span class="fibl">Select:</span><INPUT style="background-color:#e9ffe8" type="radio" name="multi" id="m1" value="0" checked="checked" onclick="keerit(this.value)"><label for="m1" class="fibl">Activities</label><br /><span class="fibl">OR Select a Lifestyle</span></td>');
  35. // LIFESTYLE BUTTON GROUP
  36.     document.write('<td rowspan="2" width="20%"><fieldset name="four" class="fibl" width=:100%><legend>Lifestyle:</legend>');
  37.    document.write('<INPUT style="background-color:#e9ffe8" class="fiel" type="radio" name="multi" id="m2" value="1.2" onclick="keerit(this.value)"><label for="m2">Bed Rest</label>');
  38.    document.write('<br /><INPUT  type="radio" name="multi" id="m3" value="1.3" onclick="keerit(this.value)"><label for="m3">Sedentary</label>');
  39.    document.write('<br /><INPUT type="radio" name="multi" id="m4" value="1.4" onclick="keerit(this.value)"><label for="m4">Active</label>');
  40.    document.write('<br /><INPUT type="radio" name="multi" id="m5" value="1.5" style="background-color:#e9ffe8"; onclick="keerit(this.value)"><label for="m5">Very Active</label>');
  41. // MULTIPLIER AND SUBMIT
  42.     document.write('</fieldset></td></tr><tr>');
  43.     document.write('<td><input type="button" id="actionclr" class="fiel" onclick="clrAct()" onmouseover="but(\'actionclr\',\'#ffe8e9\',\'navy\')" onmouseout="but(\'actionclr\',\'#e9ffe8\',\'navy\')" style="background-color:#e9ffe8" value="Clear Activities"></td>');
  44.     document.write('<td><input type="button" id="actionadd" class="fiel" onclick="addaction()" onmouseover="but(\'actionadd\',\'#ffe8e9\',\'navy\')" onmouseout="but(\'actionadd\',\'#e9ffe8\',\'navy\')" style="background-color:#e9ffe8" value="Add">');
  45.     document.write('<input type="button" id="actionback" class="fiel" onclick="popAction()" onmouseover="but(\'actionback\',\'#ffe8e9\',\'navy\')" onmouseout="but(\'actionback\',\'#e9ffe8\',\'navy\')" style="background-color:#e9ffe8" value="Undo Last"></td>');
  46.     document.write('<td><span class="fibl">Multiplier = </span><input type="text" value="0" id="multiplier" class="tees" style="align:center;width:3em"></td>');
  47.     document.write('<td></td></tr></table>');
  48.  
RAW Paste Data