Jump to content

theClerk

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by theClerk

  1. I got this code for a simple calorie calculator and the submit button redirects to a page rather than simply calculating inputted data. I'm not sure how to get the submit button to simply calculate inputted data and display the results on screen. Please help. <!doctype html> <html> <head> <meta charset="utf-8"> <!-- TemplateBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- TemplateEndEditable --> <!-- TemplateBeginEditable name="head" --> <!-- TemplateEndEditable --> </head> <body> <!-- Nav tabs --> <ul class="nav nav-tabs" id="units-tabs" role="tablist"> <li role="presentation" class="active"><a href="#imperial" aria-controls="imperial" role="tab" data-toggle="tab">Imperial</a></li> <li role="presentation"><a class="text-muted" href="#metric" aria-controls="metric" role="tab" data-toggle="tab">Metric</a></li> </ul> <div class="row"> <div class="col-sm-6 tab-content"> <div role="tabpanel" class="tab-pane active" id="imperial"> <div id="form"> <form method="post" action="/index.php"> <input type="hidden" name="system" value="imperial"> <table> <tr> <td class="col1">Gender</td> <td> <label><input type="radio" name="gender" id="male" value="male" checked> Male&nbsp;</label> <label><input type="radio" name="gender" id="female" value="female"> Female</label> </td> </tr> <tr> <td class="col1"><label for="age">Age</label></td> <td> <input type="text" name="age" class="form-control" id="age" style="width:60px;" maxlength="3" value=""> </td> </tr> <tr> <td class="col1"><label for="weight">Weight</label></td> <td><input type="text" name="weight" class="form-control" id="weight" placeholder="lbs" style="width:60px;" maxlength="3" value=""></td> </tr> <tr> <td class="col1"><label for="height">Height</label></td> <td> <select name="height" class="form-control" id="height" style="width:100px;"> <option value="55">4ft 7in</option> <option value="56">4ft 8in</option> <option value="57">4ft 9in</option> <option value="58">4ft 10in</option> <option value="59">4ft 11in</option> <option value="60">5ft 0in</option> <option value="61">5ft 1in</option> <option value="62">5ft 2in</option> <option value="63">5ft 3in</option> <option value="64">5ft 4in</option> <option value="65">5ft 5in</option> <option value="66">5ft 6in</option> <option value="67">5ft 7in</option> <option value="68">5ft 8in</option> <option value="69" selected>5ft 9in</option> <option value="70">5ft 10in</option> <option value="71">5ft 11in</option> <option value="72">6ft 0in</option> <option value="73">6ft 1in</option> <option value="74">6ft 2in</option> <option value="75">6ft 3in</option> <option value="76">6ft 4in</option> <option value="77">6ft 5in</option> <option value="78">6ft 6in</option> <option value="79">6ft 7in</option> <option value="80">6ft 8in</option> <option value="81">6ft 9in</option> <option value="82">6ft 10in</option> <option value="83">6ft 11in</option> <option value="84">7ft 0in</option> </select> </td> </tr> <tr> <td class="col1">Activity</td> <td> <select name="activity" class="form-control" style="width:200px;"> <option value="1.2" selected>Sedentary (office job)</option> <option value="1.375">Light Exercise (1-2 days/week)</option> <option value="1.55">Moderate Exercise (3-5 days/week)</option> <option value="1.725">Heavy Exercise (6-7 days/week)</option> <option value="1.9">Athlete (2x per day) </option> </select> </td> </tr> <tr> <td style="position:relative;" class="col1 text-muted"><label for="bodyfat">Body Fat %</label> <span style="position:absolute;top:26px;left:14px;">(optional)</span></td> <td id="bf"><input type="text" name="bodyfat" class="form-control" id="bodyfat" style="width:46px;display:inline-block;" maxlength="2" placeholder="15"> <span id="bodyfatpercentage">%</span> </td> </tr> <tr style="margin-top:15px;"> <td class="col1">&nbsp;</td> <td><input type="submit" class="btn btn-submit btn-lg" id="submit" name="submit" value="Calculate!"></td> </tr> </table> </form> </div> <!-- end #form --> </div> <div role="tabpanel" class="tab-pane" id="metric"> <div id="form-metric"> <form name="form-metric-tagged" method="post" action="/index.php"> <input type="hidden" name="system" value="metric"> </form> </div> <!-- end #form --> </div> </div> </div> </div> <!-- end row --> </body> </html>
  2. That all sounds good to me. I'll look into it. Thanks, @justsomeguy.
  3. I understand, @justsomeguy. Now, a primary feature is this form needs to be accessible to multiple people simulteneously and savable with different filenames. I trying to figure this out too. BONUS QUESTION: We need a text input header area, wherein text inputted will populate across pages (if we continue the HTML files route).
  4. I'm creating a web-based app and it's built on HTML, CSS, JS. I need to use JS to add the values entered in various text, checkbox, and drop-down inputs on different pages and display an output on a different page. I'm not sure what JS code to utilize for this. Basic scheme: Data inputted on 20 pages is added up or averaged, and the result is to be displayed on one summary of data page. I saw some code (see below) that does something similar, but not exactly what I need, as it does not explain how data from specific fields on various web pages can be added or averaged. I imagine I'd have to incorporate the link address of each page into the JS formula so it can know where to pull the data from. Any ideas?
  5. Thank you, JustSomeGuy. Sorry for the late reply. I'll check out React and get back to you with any questions I have.
  6. I'm tasked by my employer to turn a complex Excel document into a web-based form that must output as a clean, customer-facing PDF document as the final end result. This document must be used for different jobs, so employees currently save a copy on their computers and fill it out, giving it a different file name. My current thought is HTML + JavaScript will do the trick. The form must do the following. Summarize inputted numbers from input fields throughout the document so the numbers can be summarized on a single summary page. (see attached image.) How this currently works with the Excel doc: We have 4 summary pages and over 30 input field pages Plain numbers are entered in the input field pages The 4 summary pages use the Excel addition formula to add up the numbers from each input field on the input page, corresponding to what each summary page is summarizing Inputted data must have ability to be saved any time, so user can return to it and finish filling it out whenever. Output as a presentable, client-facing PDF Everything else, like the ability to rename the header and with each use of the document is something I believe can be done so long as the document is saved offline by users.
×
×
  • Create New...