JSFiddle - React, Tailwind, and code Playground

by Michael Belden

HTML

<div class="container">
  <h1>Green Fences</h1>
  <form action="#" id="quoteform" onsubmit="return false;">
    <script>
      document.querySelector("form").setAttribute("action", "")

    </script>
    <div>

      <fieldset>
        <legend><b>Estimated Quote Form</b></legend>

        <label>Choose Fence Type</label>
        <br>
        <br>
        <label class='radiolabel'>
          <input type="radio" name="selectedtype" id="ColorbondPanelFence" value="0">&nbsp;Colorbond Panel Fence</label>
        <br>
        <label class='radiolabel'>
          <input type="radio" name="selectedtype" id="ColorbondPostRailFence" value="0">&nbsp;Colorbond Post &amp; Rail Fence</label>
        <br>
        <label class='radiolabel'>
          <input type="radio" name="selectedtype" id="TreatedPineButtedFence" value="0">&nbsp;Treated Pine Butted Fence</label>
        <br>
        <label class='radiolabel'>
          <input type="radio" name="selectedtype" id="TreatedPineLappedFence" value="0">&nbsp;Treated Pine Lapped Fence</label>
        <br>
        <br>
        <label>Choose Fence Hight</label>
        <br>
        <br>

        <label>
          <input type="radio" name="fence" id="1.2High" value="85">&nbsp;Small 1.2 meters high</label>
        <label>
          <input type="radio" name="fence" id="1.5High" value="90">&nbsp;Medium 1.5 meters high</label>
        <label>
          <input type="radio" name="fence" id="1.8High" value="95">&nbsp;Large 1.8 meters high</label>
        <br>
        <br>
        <p>Enter Length in meters:</p>

        <input id="length" type="text" autocomplete='off' name="txtChar" onkeypress=" return isNumberKey(event)">

        <script>
          function isNumberKey(evt) {
            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
              return false;

            return true;
          }

        </script>

        <br>
        <br>
     ...

CSS

@charset "utf-8";

/* CSS Document */


/* Get rid of default padding and margin */

body {
  background-size: 1000px 200px;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #125a08;
  margin: 0px;
  padding: 5px;
  list-style-type: none;
  font-family: Arial, Helvetica, sans-serif;
}

span.tab {
  padding: 0 30px;
  /* Or desired space*/
}

.total {
  padding-top: 2px;
}

.input-symbol-dollar {
  position: relative;
  font-size: 15px;
}

.input-symbol-dollar input {
  padding-left: 14px;
}

.input-symbol-dollar:before {
  position: absolute;
  top: 0;
  content: "$";
  left: 5px;
}


/*centering website*/

.container {
  margin: 0px auto;
  border-radius: 25px;
  background: #4faa12;
  padding: 20px;
  width: 600px;
  height: 550px;
}

h1 {
  margin-top: 0;
  /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
  margin-bottom: 25px;
  padding-right: 15px;
  padding-left: 15px;
  /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
  font-size: 80px;
  font-family: Vivaldi;
  text-align: center;
  text-shadow: 3px 2px grey;
}

p {
  margin-top: 0;
  /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
  padding-right: 15px;
  padding-left: 0px;
  /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
  font-size: 16px;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
}

JavaScript

function estimate(item) {
var but = 0;
$('input:checked').each(function() {
  but += parseFloat($(this).val()) // radio button

});

var length = parseFloat($('#length').val()); // textbox
var Totalcost = length * but;

$('#Totalcost').val(Totalcost.toFixed(2));

}