Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Simple Edit Breaks Online Calculator...

    Hi all!

    I first need to ask forgiveness in advance if I appear at all dunce-like... coding and intelligent tech stuff is not my usual stomping ground.

    I can do very very basic HTML work, and I can work with templates etc. due to my minimal editing skills... but that's it.

    As such, I recently hired a gentleman to code up a multi-calculator I can use (for body fat / caloric estimates etc.).

    The job done was pretty excellent in my opinion and the calculator functions perfectly.

    The trouble is, since I asked him to 'reverse-engineer' a set of calculators found online already... some of the old links are still embedded.

    Mostly I was able to just delete the HREF and certain elements of text.

    But I ran into one bit that appears to break the whole thing.

    Here's the code for that particular calculator:

    Code:
          <h1>Daily Caloric Intake Calculator</h1>
    	  <div class="group"></div>
    	  <div class="tooltable">
            <form name="calc" class="no-space-bottom">
              <h2>DAILY CALORIC INTAKE CALCULATOR</h2>
              <div class="label-align">
                <label>Age</label>
                <span id="ageerror"><span class="tip"></span>
                <input name="age" id="age" maxlength="2" min="8" max="99" type="text">
                <label class="inline">Years </label>
                </span> </div>
              <div class="label-align">
                <label>Gender</label>
                <input name="sex" type="radio" id="sexMale" value="M" checked="checked">
                <label for="sexMale" class="inline">Male</label>
                 <input name="sex" id="sexFem" value="F" type="radio">
                <label for="sexFem" class="inline">Female</label>
              </div>
              <div class="label-align">
                <label>Current Weight</label>
                <span id="weighterror"><span class="tip"></span>
                <input name="weight" id="weight" maxlength="3" type="text">
                </span>
                <input name="weighttype" class="rad" id="weighttype1" value="P" checked="checked" type="radio">
                <label for="weighttype1" class="inline">Pounds</label>
                <input name="weighttype" class="rad" id="weighttype2" value="K" type="radio">
                <label for="weighttype2" class="inline">Kilos</label>
              </div>
              <div class="label-align">
                <label>Height</label>
                <input name="height" class="rad" id="heightFeet" value="F" checked="checked" onclick="calorie_showFeet();" type="radio">
                <label class="inline" for="heightFeet">Feet &amp; Inches</label>
                <input name="height" class="rad" id="heightCM" value="C" onclick="calorie_showCM();" type="radio">
                <label class="inline" for="heightCM">CMs</label>
                <div id="feetlabel">
                  <label>Feet</label>
                  <span id="feeterror"><span class="tip"></span>
                  <input name="feet" id="feet" maxlength="1" type="text">
                  </span>
                  <label class="inline">Inches</label>
                  <span id="incheserror"><span class="tip"></span>
                  <input name="inches" id="inches" maxlength="2" type="text">
                  </span> </div>
                <div id="cmlabel" style="display:none;">
                  <label>CM</label>
                  <span id="cmerror"><span class="tip"></span>
                  <input name="cm" id="cm" maxlength="3" type="text">
                  </span> </div>
              </div>
              <div class="label-align">
                <label>Exercise level</label>
                <select name="activity" id="activity">
                  <option value="1.0">Basal Metabolic Rate</option>
                  <option value="1.2">Little/no exercise</option>
                  <option selected="selected" value="1.375">3 times/week</option>
                  <option value="1.4187">4 times/week</option>
                  <option value="1.4625">5 times/week</option>
                  <option value="1.550">5 times/week (intense)</option>
                  <option value="1.6375">Every day</option>
                  <option value="1.725">Every day (intense) or twice daily</option>
                  <option value="1.9">Daily exercise + physical job</option>
                </select>
                <div class="formnote">Exercise = 20 mins elevated heart rate. <br>
                  Intense = 1 hour elevated heart rate</div>
              </div>
              <div class="text-center dropdown-calc"> <a class="btn btn-blue " href="#" onclick="calorie_toggleMe(this,'advanced');return false;"><i class="icon-cogs"></i> Advanced Options</a></div>
              <div id="advanced">
                <label class="text-bold">Results in</label>
                <input name="optResults" class="rad" id="optResults" value="C" checked="checked" type="radio">
                <label for="optResults" class="inline">Calories</label>
                <input name="optResults" class="rad" id="optResults2" value="K" type="radio">
                <label for="optResults2" class="inline">Kilojoules</label>
                <label class="text-bold">Formula</label>
                <input class="rad" name="optFormula" id="optMS" value="M" checked="checked" onclick="document.getElementById('txtBF').disabled=true;" type="radio">
                <label for="optMS" class="inline">Mifflin-St Jeor</label>
                <br>
                <input class="rad" name="optFormula" id="optLM" value="L" onclick="document.getElementById('txtBF').disabled=false;document.getElementById('txtBF').focus();" type="radio">
                <label for="optLM" class="inline">Katch-McArdle: Enter Body Fat %</label>
                <span id="bferror"><span class="tip"></span>
                <input name="txtBF" class="text-small input-inline" id="txtBF" size="2" maxlength="2" disabled="disabled" type="text">
                <br>
                <input class="rad" name="optFormula" id="optHB" value="H" onclick="document.getElementById('txtBF').disabled=true;" type="radio">
                <label for="optHB" class="inline">Harris-Benedict</label>
                </span>
                </div>
              <div class="space-top-large">
                <input class="btn btn-blue btn-large float-center text-tall" value="Calculate" onclick="calcalcIt();cancelDefaultAction(event);" id="Button1" name="Button1" type="submit">
              </div>
              <div id="printArea" style="display:none;">
                <div id="printAreainset">
                  <h2 id="results">RESULTS</h2>
                  <div class="tooltable float-center" style="min-width:80%;box-shadow:0 0 40px rgba(0,0,0,0.1) inset; border:none;">
                    <label class="text-center">Total Calories Including Exercise</label>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                      <tbody><tr>
                        <td class="tooltable-cell-width" align="right"><label class="biglabel">Maintenance</label></td>
                        <td class="tooltable-cell-width" align="left"><span class="calwrap" id="answer">?<span class="cals">CALORIES/DAY</span></span></td>
                      </tr>
                      <tr>
                        <td align="right"><label class="biglabel">Fat Loss</label></td>
                        <td align="left"><span class="calwrap" id="lose">?<span class="cals">CALORIES/DAY</span></span></td>
                      </tr>
                      <tr>
                        <td align="right" valign="middle"><label class="biglabel">Extreme Fat Loss</label></td>
                        <td align="left"><span class="calwrap" id="loseExt">?<span class="cals">CALORIES/DAY</span></span></td>
                      </tr>
                      <tr>
                        <td colspan="2" align="center"><div class="dropdown-calc"><a class="btn btn-blue" href="#" onclick="calorie_toggleMe(this,'zigResults');return false;">7 day calorie cycle (zig-zag)</a></div></td>
                      </tr>
                    </tbody></table>
                    <div id="zigResults" class="displayNone" style="background-color:#fff;">
                      <table id="zigResultsTable" border="0" cellpadding="0" cellspacing="0">
                        <tbody><tr>
                          <td>&nbsp;</td>
                          <td align="right"><strong>Maintenance</strong></td>
                          <td align="right" bgcolor="#efefef"><strong>Fat Loss</strong></td>
                          <td align="right"><strong>Extreme Fat Loss</strong></td>
                        </tr>
                        <tr>
                          <td><strong>Monday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Tuesday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Wednesday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Thursday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Friday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Saturday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Sunday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                      </tbody></table>
                    </div>
                  </div>
                </div>
                <div style="margin:10px 50px 0 0;text-align:right;"><a style="text-decoration:none;color:#aaa;" href="#" onclick="printThis('printAreainset');return false;" title="Print results"><img src="Calorie%20Calculator%20-%20Daily%20Caloric%20Needs111_files/print-icon.png" style="vertical-align:middle;" alt="Print results" height="19" width="17"> Print</a></div>
                <div id="nowwhat" class="float-center"><b>Now what?</b>
                  <ol>
                    <li>Read the rest of this page: It's really helpful.</li>
                    <li>See meal plans for <a href="http://www.freedieting.com/1100_calorie_diet.htm" target="_meals">1100 calories</a>, <a href="http://www.freedieting.com/1200_calorie_diet.htm" target="_meals">1200</a>, <a href="http://www.freedieting.com/1350_calorie_diet.htm" target="_meals">1350</a>, <a href="http://www.freedieting.com/1400_calorie_diet.htm" target="_meals">1400</a>, <a href="http://www.freedieting.com/1500_calorie_diet.htm" target="_meals">1500</a>. (<a target="_meals" href="http://www.freedieting.com/free_diet_plans.htm">More plans here</a>).</li>
                    <li>See what <a target="_meals" href="http://www.freedieting.com/low_cal_meals.htm">low calorie meals look like</a>.</li>
                    <li>Experts: Tweak carb/fat/protein with our <a href="http://www.freedieting.com/tools/nutrient_calculator.htm" id="linkNutrient" target="_meals">nutrient calculator</a>.</li>
                  </ol>
                </div>
              </div>
            </form>
          </div>
    	</div>
    </div>

    And here's the bit I'm trying to remove:

    Code:
     <div id="nowwhat" class="float-center"><b>Now what?</b>
                  <ol>
                    <li>Read the rest of this page: It's really helpful.</li>
                    <li>See meal plans for <a href="http://www.freedieting.com/1100_calorie_diet.htm" target="_meals">1100 calories</a>, <a href="http://www.freedieting.com/1200_calorie_diet.htm" target="_meals">1200</a>, <a href="http://www.freedieting.com/1350_calorie_diet.htm" target="_meals">1350</a>, <a href="http://www.freedieting.com/1400_calorie_diet.htm" target="_meals">1400</a>, <a href="http://www.freedieting.com/1500_calorie_diet.htm" target="_meals">1500</a>. (<a target="_meals" href="http://www.freedieting.com/free_diet_plans.htm">More plans here</a>).</li>
                    <li>See what <a target="_meals" href="http://www.freedieting.com/low_cal_meals.htm">low calorie meals look like</a>.</li>
                    <li>Experts: Tweak carb/fat/protein with our <a href="http://www.freedieting.com/tools/nutrient_calculator.htm" id="linkNutrient" target="_meals">nutrient calculator</a>.</li>
                  </ol>
                </div>
    However... it appears whenever I remove anything from that section of code, the calculator stops functioning and simply resets itself.


    I've done the best I can to make this as clear as possible... but not being as bright as you fellas, I'm not sure if I hit the nail on the head or not

    If there's any more I can do to provide information, please let me know.

    And thanks so much in advance!

    Sincerely,

    Adam

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,041
    Thanks
    23
    Thanked 589 Times in 588 Posts
    Just removing that section of HTML should not cause problems. There has to be more to it. Post the rest of the code.

    BTW you have two <div> at the end of the first post that are extraneous.
    Evolution - The non-random survival of random variants.

  • Users who have thanked sunfighter for this post:

    Adam1900 (12-23-2013)

  • #3
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks Sunfighter...

    You know I saw that DIV and wondered if they needed to be there... maybe I'm not as thick as I thought

    Alright... here's the whole thing (Part 1):

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <!--[if lt IE 9 & !IEMobile]><html class="ie" lang="en"><![endif]-->
    <!--[if gt IE 8 | IEMobile]><!-->
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link href="css/css.css" rel="stylesheet" type="text/css">
    <link href="css/calorie.css" rel="stylesheet" type="text/css">
    <link href="css/weight.css" rel="stylesheet" type="text/css">
    <link href="css/bodyfat.css" rel="stylesheet" type="text/css">
    <link href="css/grecianideal.css" rel="stylesheet" type="text/css">
    <!-- #BeginEditable "doctitle" -->
    <title>Adam's Calculators</title>
    <!-- #EndEditable -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- #BeginEditable "metatags" -->
    <meta name="Keywords" content="bulking, bulk up, calculator,daily calorie needs,calorie,calculators,diet">
    <meta name="Description" content="Health Calculator: Calculates optimum daily calorie amounts for quality muscle gain. Also includes number of carbs, protein, and fats for every meal. ">
    <!-- #EndEditable -->
    <link rel="stylesheet" href="css/style10.css" type="text/css">
    <script>if ('querySelector' in document && 'addEventListener' in window ) { document.documentElement.className += 'js';}</script>
    <!-- #BeginEditable "scripts" -->
    <script src="js/jquery-1.9.1.js" type="text/javascript"></script> 
    <script src="js/calorie.js" type="text/javascript"></script> 
    <script src="js/weight.js" type="text/javascript"></script> 
    <script src="js/bodyfat.js" type="text/javascript"></script> 
    <script src="js/grecianideal.js" type="text/javascript"></script> 
    <!-- #EndEditable -->
    </head>
    <body>
    <!--[if lt IE 8]>
    <section class="container">
    Did you know that your web browser is a bit old? Some of the content on this site might not work right as a result. <a href="http://whatbrowser.org">Upgrade your browser</a> for a faster, better, and safer web experience.
    </section>
    <![endif]-->
    <!-- #BeginLibraryItem "/Library/Tools.lbi" -->
    <div class="dropdown space-bottom-small"> <a class="btn btn-blue" href="http://www.freedieting.com/tools/weight_loss_tools.htm"><i class="icon-cogs"></i>Calculators</a>
      <div class="dropdown-menu">
        <ul class="calc-list">
          <li><a href="javascript:void(0);" onclick="activate_calculator(0);" >Daily Caloric Intake</a></li>
          <li><a href="javascript:void(0);" onclick="activate_calculator(1);" >Muscular Weight Gain</a></li>
          <li><a href="javascript:void(0);" onclick="activate_calculator(2);" >Body Fat %</a></li>
          <li><a href="javascript:void(0);" onclick="activate_calculator(3);" >Male Grecian Ideal</a></li>
        </ul>
      </div>
    </div>
    <!-- #EndLibraryItem -->
    <section class="container">
        <!-- Left sidebar -->
    <div id="calorie" class="calculator">
        <div class="col-12 col-sm-9 col-lg-7"> <!-- #BeginEditable "contentarea" -->
          <h1>Daily Caloric Intake Calculator</h1>
    	  <div class="group"></div>
    	  <div class="tooltable">
            <form name="calc" class="no-space-bottom">
              <h2>DAILY CALORIC INTAKE CALCULATOR</h2>
              <div class="label-align">
                <label>Age</label>
                <span id="ageerror"><span class="tip"></span>
                <input name="age" id="age" maxlength="2" min="8" max="99" type="text">
                <label class="inline">Years </label>
                </span> </div>
              <div class="label-align">
                <label>Gender</label>
                <input name="sex" type="radio" id="sexMale" value="M" checked="checked">
                <label for="sexMale" class="inline">Male</label>
                 <input name="sex" id="sexFem" value="F" type="radio">
                <label for="sexFem" class="inline">Female</label>
              </div>
              <div class="label-align">
                <label>Current Weight</label>
                <span id="weighterror"><span class="tip"></span>
                <input name="weight" id="weight" maxlength="3" type="text">
                </span>
                <input name="weighttype" class="rad" id="weighttype1" value="P" checked="checked" type="radio">
                <label for="weighttype1" class="inline">Pounds</label>
                <input name="weighttype" class="rad" id="weighttype2" value="K" type="radio">
                <label for="weighttype2" class="inline">Kilos</label>
              </div>
              <div class="label-align">
                <label>Height</label>
                <input name="height" class="rad" id="heightFeet" value="F" checked="checked" onclick="calorie_showFeet();" type="radio">
                <label class="inline" for="heightFeet">Feet &amp; Inches</label>
                <input name="height" class="rad" id="heightCM" value="C" onclick="calorie_showCM();" type="radio">
                <label class="inline" for="heightCM">CMs</label>
                <div id="feetlabel">
                  <label>Feet</label>
                  <span id="feeterror"><span class="tip"></span>
                  <input name="feet" id="feet" maxlength="1" type="text">
                  </span>
                  <label class="inline">Inches</label>
                  <span id="incheserror"><span class="tip"></span>
                  <input name="inches" id="inches" maxlength="2" type="text">
                  </span> </div>
                <div id="cmlabel" style="display:none;">
                  <label>CM</label>
                  <span id="cmerror"><span class="tip"></span>
                  <input name="cm" id="cm" maxlength="3" type="text">
                  </span> </div>
              </div>
              <div class="label-align">
                <label>Exercise level</label>
                <select name="activity" id="activity">
                  <option value="1.0">Basal Metabolic Rate</option>
                  <option value="1.2">Little/no exercise</option>
                  <option selected="selected" value="1.375">3 times/week</option>
                  <option value="1.4187">4 times/week</option>
                  <option value="1.4625">5 times/week</option>
                  <option value="1.550">5 times/week (intense)</option>
                  <option value="1.6375">Every day</option>
                  <option value="1.725">Every day (intense) or twice daily</option>
                  <option value="1.9">Daily exercise + physical job</option>
                </select>
                <div class="formnote">Exercise = 20 mins elevated heart rate. <br>
                  Intense = 1 hour elevated heart rate</div>
              </div>
              <div class="text-center dropdown-calc"> <a class="btn btn-blue " href="#" onclick="calorie_toggleMe(this,'advanced');return false;"><i class="icon-cogs"></i> Advanced Options</a></div>
              <div id="advanced">
                <label class="text-bold">Results in</label>
                <input name="optResults" class="rad" id="optResults" value="C" checked="checked" type="radio">
                <label for="optResults" class="inline">Calories</label>
                <input name="optResults" class="rad" id="optResults2" value="K" type="radio">
                <label for="optResults2" class="inline">Kilojoules</label>
                <label class="text-bold">Formula</label>
                <input class="rad" name="optFormula" id="optMS" value="M" checked="checked" onclick="document.getElementById('txtBF').disabled=true;" type="radio">
                <label for="optMS" class="inline">Mifflin-St Jeor</label>
                <br>
                <input class="rad" name="optFormula" id="optLM" value="L" onclick="document.getElementById('txtBF').disabled=false;document.getElementById('txtBF').focus();" type="radio">
                <label for="optLM" class="inline">Katch-McArdle: Enter Body Fat %</label>
                <span id="bferror"><span class="tip"></span>
                <input name="txtBF" class="text-small input-inline" id="txtBF" size="2" maxlength="2" disabled="disabled" type="text">
                <br>
                <input class="rad" name="optFormula" id="optHB" value="H" onclick="document.getElementById('txtBF').disabled=true;" type="radio">
                <label for="optHB" class="inline">Harris-Benedict</label>
                </span>
                </div>
              <div class="space-top-large">
                <input class="btn btn-blue btn-large float-center text-tall" value="Calculate" onclick="calcalcIt();cancelDefaultAction(event);" id="Button1" name="Button1" type="submit">
              </div>
              <div id="printArea" style="display:none;">
                <div id="printAreainset">
                  <h2 id="results">RESULTS</h2>
                  <div class="tooltable float-center" style="min-width:80%;box-shadow:0 0 40px rgba(0,0,0,0.1) inset; border:none;">
                    <label class="text-center">Total Calories Including Exercise</label>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                      <tbody><tr>
                        <td class="tooltable-cell-width" align="right"><label class="biglabel">Maintenance</label></td>
                        <td class="tooltable-cell-width" align="left"><span class="calwrap" id="answer">?<span class="cals">CALORIES/DAY</span></span></td>
                      </tr>
                      <tr>
                        <td align="right"><label class="biglabel">Fat Loss</label></td>
                        <td align="left"><span class="calwrap" id="lose">?<span class="cals">CALORIES/DAY</span></span></td>
                      </tr>
                      <tr>
                        <td align="right" valign="middle"><label class="biglabel">Extreme Fat Loss</label></td>
                        <td align="left"><span class="calwrap" id="loseExt">?<span class="cals">CALORIES/DAY</span></span></td>
                      </tr>
                      <tr>
                        <td colspan="2" align="center"><div class="dropdown-calc"><a class="btn btn-blue" href="#" onclick="calorie_toggleMe(this,'zigResults');return false;">7 day calorie cycle (zig-zag)</a></div></td>
                      </tr>
                    </tbody></table>
                    <div id="zigResults" class="displayNone" style="background-color:#fff;">
                      <table id="zigResultsTable" border="0" cellpadding="0" cellspacing="0">
                        <tbody><tr>
                          <td>&nbsp;</td>
                          <td align="right"><strong>Maintenance</strong></td>
                          <td align="right" bgcolor="#efefef"><strong>Fat Loss</strong></td>
                          <td align="right"><strong>Extreme Fat Loss</strong></td>
                        </tr>
                        <tr>
                          <td><strong>Monday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Tuesday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Wednesday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Thursday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Friday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Saturday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                        <tr>
                          <td><strong>Sunday</strong></td>
                          <td align="right">&nbsp;</td>
                          <td align="right" bgcolor="#efefef">&nbsp;</td>
                          <td align="right">&nbsp;</td>
                        </tr>
                      </tbody></table>
                    </div>
                  </div>
                </div>

    Thanks for helping out with this man... really hoping it's not as difficult for you as it seems to be for me

    (Part 2 below)

  • #4
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Part 2!

    Code:
                <div style="margin:10px 50px 0 0;text-align:right;"><a style="text-decoration:none;color:#aaa;" href="#" onclick="printThis('printAreainset');return false;" title="Print results"><img src="Calorie%20Calculator%20-%20Daily%20Caloric%20Needs111_files/print-icon.png" style="vertical-align:middle;" alt="Print results" height="19" width="17"> Print</a></div>
                <div id="nowwhat" class="float-center"><b>Now what?</b>
                  <ol>
                    <li>Read the rest of this page: It's really helpful.</li>
                    <li>See meal plans for <a href="http://www.freedieting.com/1100_calorie_diet.htm" target="_meals">1100 calories</a>, <a href="http://www.freedieting.com/1200_calorie_diet.htm" target="_meals">1200</a>, <a href="http://www.freedieting.com/1350_calorie_diet.htm" target="_meals">1350</a>, <a href="http://www.freedieting.com/1400_calorie_diet.htm" target="_meals">1400</a>, <a href="http://www.freedieting.com/1500_calorie_diet.htm" target="_meals">1500</a>. (<a target="_meals" href="http://www.freedieting.com/free_diet_plans.htm">More plans here</a>).</li>
                    <li>See what <a target="_meals" href="http://www.freedieting.com/low_cal_meals.htm">low calorie meals look like</a>.</li>
                    <li>Experts: Tweak carb/fat/protein with our <a href="http://www.freedieting.com/tools/nutrient_calculator.htm" id="linkNutrient" target="_meals">nutrient calculator</a>.</li>
                  </ol>
                </div>
              </div>
            </form>
          </div>
    	</div>
    </div>
    
    <div id="weight" class="calculator">
        <div class="col-12 col-sm-9 col-lg-7"> <!-- #BeginEditable "contentarea" -->
          <h1>Muscular Weight Gain Calculator </h1>
    	  <div class="tooltable">
            <form name="calc">
              <h2>MUSCULAR WEIGHT GAIN CALCULATOR</h2>
              <div class="label-align">
                <label>Age</label>
                <span id="ageerror"><span class="tip"></span>
                <input name="age" id="age" size="2" maxlength="2" min="15" max="60" type="number">
                <label class="inline">Years </label>
                </span> </div>
              <div class="label-align">
                <label>Gender</label>
                <input name="sex" id="sexMale" value="M" checked="checked" type="radio">
                <label for="sexMale" class="inline">Male</label>
                <input name="sex" id="sexFem" value="F" type="radio">
                <label for="sexFem" class="inline">Female</label>
              </div>
              <div class="label-align">
                <label>Weight</label>
                <span id="weighterror"><span class="tip"></span>
                <input name="weight" id="weight" size="2" maxlength="3" type="number">
                </span>
                <input name="weighttype" class="rad" id="weighttype1" value="P" checked="checked" type="radio">
                <label for="weighttype1" class="inline">Pounds</label>
                <input name="weighttype" class="rad" id="weighttype2" value="K" type="radio">
                <label for="weighttype2" class="inline">Kilos</label>
              </div>
              <div class="label-align">
                <label>Height</label>
                <input name="height" class="rad" id="heightFeet" value="F" checked="checked" onclick="weight_showFeet();" type="radio">
                <label class="inline" for="heightFeet">Feet &amp; Inches</label>
                <input name="height" class="rad" id="heightCM" value="C" onclick="weight_showCM();" type="radio">
                <label class="inline" for="heightCM">CMs</label>
                <div id="feetlabel">
                  <label>Feet</label>
                  <span id="feeterror"><span class="tip"></span>
                  <input name="feet" id="feet" size="2" maxlength="1" min="1" max="8" type="number">
                  </span>
                  <label class="inline">Inches</label>
                  <span id="incheserror"><span class="tip"></span>
                  <input name="inches" id="inches" size="2" maxlength="2" type="number">
                  </span> </div>
                <div id="cmlabel" style="display:none;">
                  <label>CM</label>
                  <span id="cmerror"><span class="tip"></span>
                  <input name="cm" id="cm" size="2" maxlength="3" type="number">
                  </span> </div>
              </div>
              <div class="label-align">
                <label>Meals per day</label>
                <label class="inline">
                  <input name="optMeals" value="3" type="radio">
                  Three</label>
                <label class="inline">
                  <input name="optMeals" value="4" type="radio">
                  Four</label>
                <label class="inline">
                  <input name="optMeals" value="5" checked="checked" type="radio">
                  Five</label>
                <label class="inline">
                  <input name="optMeals" value="6" type="radio">
                  Six</label>
              </div>
              <div class="label-align">
                <label>Calorie Boost?</label>
                <input name="chkBoost" id="chkBoost" value="checkbox" type="checkbox">
              </div>
              <div class="formnote">Activity level is based on 3 weight training sessions per week, and little or no cardio.</div>
              <p class="space-top-large">
                <input class="btn btn-blue btn-large float-center text-tall" value="Calculate" onclick="weight_calcIt();cancelDefaultAction(event);" id="Button1" name="Button1" type="submit">
              </p>
              <h2>RESULTS</h2>
              <table id="tblOutput" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tbody><tr>
                      <td colspan="4" align="center"><div id="answer" style="margin:15px 0;font-size:22px;color:#666;"></div></td>
                    </tr>
                    <tr>
                      <td align="right" width="40%">&nbsp;</td>
                      <td align="right" width="20%"><div id="lose" style="font-weight:bold">CARBS</div></td>
                      <td align="right" width="20%"><strong>PROTEIN</strong></td>
                      <td align="right" width="20%"><strong>FATS</strong></td>
                    </tr>
                    <tr>
                      <td align="right"><b> GRAMS PER MEAL </b></td>
                      <td align="right"><div id="mealcarb"> </div></td>
                      <td align="right"><div id="mealpro"> </div></td>
                      <td align="right"><div id="mealfat"> </div></td>
                    </tr>
                    <tr>
                      <td align="right"><b> GRAMS PER DAY </b></td>
                      <td align="right"><div id="daycarb"> </div></td>
                      <td align="right"><div id="daypro"> </div></td>
                      <td align="right"><div id="dayfat"> </div></td>
                    </tr>
              </tbody></table>
            </form>
          </div>
      </div>
    </div>
    
    <div id="bodyfat" class="calculator">
        <div class="col-12 col-sm-9 col-lg-7"> <!-- #BeginEditable "contentarea" -->
          <h1>Body Fat Percentage Calculator</h1>
    
    	<form name="bodyfat">
            <div class="tooltable">
              <h2>BODY FAT PERCENTAGE CALCULATOR</h2>
              <p>
                <label class="inline-right">Age</label>
                <span id="ageerror"><span class="tip"></span>
                <input name="age" id="age" size="2" maxlength="3" type="text">
                <label class="inline">Years</label>
                </span> </p>
              <p>
                <label class="inline-right">Gender</label>
                <input name="optGender" id="sexMale2" value="M" checked="checked" type="radio">
                <label for="sexMale2" class="inline">Male</label>
                <input name="optGender" id="sexFem2" value="F" type="radio">
                <label for="sexFem2" class="inline">Female</label>
              </p>
              <p>
                <label class="inline-right">Weight</label>
                <span id="weighterror"><span class="tip"></span>
                <input name="Weight" maxlength="3" id="Weight" type="text">
                <input id="weightPounds" name="weighttype" value="P" checked="checked" type="radio">
                <label for="weightPounds" class="inline">Pounds</label>
                <input id="weightKilos" name="weighttype" value="K" type="radio">
                <label for="weightKilos" class="inline">Kilos</label>
                </span></p>
              <p>
                <label class="inline-right">Method</label>
                <input name="optMethod" id="optEst" value="P" checked="checked" type="radio">
                <label for="optEst" class="inline"> Estimate</label>
                <input name="optMethod" id="optSkinfold" value="K" type="radio">
                <label for="optSkinfold" class="inline">Skinfold* (More Accurate)</label>
                <span class="formnote displayBlock">*To do a skinfold test you need fat calipers.</span></p>
              <div id="divEst" class="float-center displayBlock"> <strong>ESTIMATE</strong>
                <p>
                  <label class="inline">Waist</label>
                  <span id="waisterror"><span class="tip"></span>
                  <input name="txtWaist" id="txtWaist" value="0" size="2" maxlength="4" type="text">
                  <label class="inline">inches</label>
                  </span> </p>
                <div class="formnote">Men: Measure at the navel.<br>
                  Women: Measure halfway between navel and sternum (breastbone).</div>
              </div>
              <div id="divSkinMen" class="float-center"> <b>SKINFOLD MEASUREMENTS - MEN</b>
                <div class="space-top">
                  <p>
                    <label class="inline">Chest</label>
                    <span id="chesterror"><span class="tip"></span>
                    <input name="Chest" id="Chest" value="0" size="2" maxlength="3" type="text">
                    </span>
                    <label class="inline">mm</label>
                  </p>
                  <div class="formnote">Take the fold about halfway between the armpit crease and the nipple.</div>
                  <img src="Body%20Fat%20Calculator111_files/calipers-chest.jpg" height="161" width="300"> </div>
                <div class="space-top">
                  <p>
                    <label class="inline">Abdomen</label>
                    <span id="aberror"><span class="tip"></span>
                    <input name="Ab" id="Ab" value="0" size="2" maxlength="3" type="text">
                    </span>
                    <label class="inline">mm</label>
                  </p>
                  <div class="formnote">Take the fold (vertical) about 1 inch to the side of the navel.</div>
                  <img src="Body%20Fat%20Calculator111_files/fatcalipers.jpg" height="164" width="300"> </div>
                <div class="space-top">
                  <p>
                    <label class="inline">Thigh</label>
                    <span id="thigherror"><span class="tip"></span>
                    <input name="Thigh" id="Thigh" value="0" size="2" maxlength="3" type="text">
                    </span>
                    <label class="inline">mm</label>
                  </p>
                  <div class="formnote">Take the fold at front of thigh halfway between knee and hip.</div>
                  <img src="Body%20Fat%20Calculator111_files/calipers-thigh.jpg" height="124" width="300"> </div>
              </div>
              <div id="divSkinWomen" class="float-center"> <b>SKINFOLD MEASUREMENTS - WOMEN</b>
                <div class="space-top">
                  <p>
                    <label class="inline">Triceps</label>
                    <span id="triceperror"><span class="tip"></span>
                    <input name="Tricep" id="Tricep" value="0" size="2" maxlength="3" type="text">
                    </span>
                    <label class="inline">mm</label>
                  </p>
                  <div class="formnote">Take the fold halfway between elbow and shoulder.</div>
                  <img src="Body%20Fat%20Calculator111_files/triceps-caliper.jpg" height="150" width="300"> </div>
                <div class="space-top">
                  <p>
                    <label class="inline">Abdomen</label>
                    <span id="abwerror"><span class="tip"></span>
                    <input name="AbW" id="AbW" value="0" size="2" maxlength="3" type="text">
                    </span>
                    <label class="inline">mm</label>
                  </p>
                  <div class="formnote">Take the fold (vertical) about 1 inch to the side of the navel.</div>
                  <img src="Body%20Fat%20Calculator111_files/fatcalipers.jpg" height="164" width="300"> </div>
                <div class="space-top">
                  <p>
                    <label class="inline">Suprailiac</label>
                    <span id="supraerror"><span class="tip"></span>
                    <input name="Supra" id="Supra" value="0" size="2" maxlength="3" type="text">
                    </span>
                    <label class="inline">mm</label>
                  </p>
                  <div class="formnote">Take the fold (diagonal) halfway between hip joint and bottom of rib cage.</div>
                  <img src="Body%20Fat%20Calculator111_files/calipers-suprailic.jpg" height="145" width="300"> </div>
              </div>
              <p class="space-top-large">
                <input class="btn btn-blue btn-large float-center text-tall" value="Calculate" onclick="bodyfat_calcIt();cancelDefaultAction(event);" id="Button1" name="Button1" type="submit">
              </p>
              <div class="tooltable text-center space-top45" style="box-shadow:0 0 40px rgba(0,0,0,0.1) inset;">
                <h2>RESULTS</h2>
                <p>
                  <label class="biglabel">Body Fat %</label>
                  <span class="calwrap" id="bodyFat">?</span></p>
                <p>
                  <label class="biglabel">Fat Weight</label>
                  <span class="calwrap" id="fatWeight">?<br>
                  <span class="cal">-</span></span></p>
                <p>
                  <label class="biglabel">Lean Weight</label>
                  <span class="calwrap" id="leanWeight">?<br>
                  <span class="cal">-</span></span> </p>
              </div>
           
            </div>
          </form>
    	</div> 
    </div>
    
    <div id="grecianideal" class="calculator" >
    	<div class="col-12 col-sm-9 col-lg-7">
    	<h1>Male Grecian Ideal Calculator</h1>
    		<div class="group"></div>
    		<div class="tooltable">
    		<form class="no-space-bottom" name="ideal">
    		<h2>MALE "GRECIAN IDEAL" CALCULATOR</h2>
    		<div>Enter the measurement of your wrist to find your own "ideal measurements."</div>
    
    			<table border="0" cellpadding="4" cellspacing="4" width="100%" >
    				<tbody>
    				<tr><td colspan="4"><font face="arial" size="1"></font></td></tr>
    				<tr>
    					<td align="right"><font color="#000000" face="arial" size="2"><b>Wrist</b></font></td>
    					<td><font face="arial" size="2"><input name="bodymass2" size="5" type="text"></font></td>
    					<td> <select name="measurement2"><option selected="selected" value="">Select One</option><option value="1">Inches</option><option value="2">Centimeters</option></select></td>
    					<td></td>
    				</tr>
    				<tr>
                      <td colspan="3"><font color="#000000" face="arial" size="2"><img src="Bodybuilding.com%20-%20Know%20Your%20Measurements%20For%20Bodybuilding%20Success111_files/spacer.gif" height="1" width="20"><b>Results</b></font></td>
                    </tr>
                    <tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Chest</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="ichest"></div></font></b></td>
                    </tr>
    				<tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Waist</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="iwaist"></div></font></b></td>
                    </tr>
    				<tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Hip</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="ihip"></div></font></b></td>
                    </tr>
    				<tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Bicep</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="ibicep"></div></font></b></td>
                    </tr>
    				<tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Forearm</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="iforearm"></div></font></b></td>
                    </tr>
    				<tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Thigh</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="ithigh"></div></font></b></td>
                    </tr>
    				<tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Calve</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="icalve"></div></font></b></td>
                    </tr>
    				<tr>
                      <td align="right" bgcolor="#CCCCCC"><font color="#000000" face="arial" size="2"><b>Neck</b> </font></td>
    
                      <td colspan="3" bgcolor="#dcdcdc"><b><font face="arial" size="2"><div id="ineck"></div></font></b></td>
                    </tr>
                    <tr>
                    	<td colspan="4">
                    	<div class="space-top-large">
    						<input id="Button1" class="btn btn-blue btn-large float-center text-tall" type="submit" name="Button1" onclick="idealcalculate();cancelDefaultAction(event);" value="Calculate">
    					</div>
                    	</td>
                    </tr>
    			</tbody></table>
    		</form>
    		</div>
    	</div>
    </div>
    
    </section>
    <script src="js/tools.js" type="text/javascript"></script> 
    </body>
    </html>

    Thanks again man

  • #5
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,041
    Thanks
    23
    Thanked 589 Times in 588 Posts
    So sorry. I should have said post the javascript calcalcIt() function and everything it calls.
    Evolution - The non-random survival of random variants.

  • Users who have thanked sunfighter for this post:

    Adam1900 (12-24-2013)

  • #6
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    No need to apologise man!

    I'm afraid I don't know quite enough to fulfill your request (beyond uploading the whole thing... 1x HTML / 6x JS / 6x CSS) HOWEVER...

    ... I did a little more 'titration' just deleting specific and individual elements of the second bit of code in post #1

    It turns out I've zeroed in on the problem.

    I can delete literally everything and the calculator continue to perform fine EXCEPT for this:

    Code:
    id="linkNutrient"
    If that id is removed, edited, or changed at all it shuts down the functionality of the calculator.

    Funnily enough I've been able to delete the DIV it was contained in... so now it's just spare code.

    So it 'could' stay in there... I just really don't want it there! Creepy bit of disastrous code.


    So I suppose the question now is... how / why would that element cause a calculator to stop functioning?

    Thanks again,

    (And happy holidays!)

    Adam

  • #7
    New to the CF scene
    Join Date
    Dec 2013
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Actually it's this bit of code:

    Code:
                    <a href="" id="linkNutrient" target="_meals"></a>

    I found the 'linkNutrient' bit mentioned in a JavaScript file as well... so I'm wondering if it totally should be there, and if I've successfully removed everything else... then I got what I wanted?

    Strangeness.

    Any further insight will of course be met with total gratitude


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •