Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142239

Is there a js fuction or html property to format text into input area?

$
0
0

Can anyone help with the code bellow? It doesn't load the whole text into the specific input. Try to type 5.9 ph and show explanation and you will see the test comes in one line and I would like the whole text to appear nicely into the whole area.

The script works fine but I don't know what would be the best solution for this.

Please help me out here.

<!DOCTYPE html><html><head><meta charset="UTF-8"><title> HEALTH APP</title><style>
    body {
  margin:0px;
}
.colour-block {
  background:#33B5E5;
  width:60%;
  padding:7% 20% 10% 20%;
  color:#fff;
}
.white-block {
  background:#fff;
  width:60%;
  padding:7% 20% 10% 20%;
  color:#33B5E5;
}
h1 {
  text-align:center;
  font-size:80px;
  font-family:'wire one', serif;
  font-weight:normal;
}
p {
  font-size:20px;
  font-family:'Raleway', serif;
}


/*------------------*/
/*  SKEW CLOCKWISE  */
/*------------------*/
.skew-cc{
  width:100%;
  height:100px;
  position:absolute;
  left:0px;
  background: linear-gradient(to right bottom, #33B5E5 49%, #fff 50%),    linear-gradient(-50deg, #ffffff 16px, #000 0);
}


/*-------------------------*/
/* SKEW COUNTER CLOCKWISE  */
/*-------------------------*/
.skew-c{
  width:100%;
  height:100px;
  position:absolute;
  left:0px;
  background: linear-gradient(to left bottom, #fff 49%, #33B5E5 50%);
}

    </style><script language="JavaScript"><!--
  function calculatePH2() {
          var ph2 = document.ph2Form.ph2.value
          if (ph2 > 4.5 && ph2 < 5.0) {
              document.ph2Form.meaning.value = "If a person has low urine pH, meaning that it is more acidic, it might indicate a medical condition such as: diabetic ketoacidosis, which is a complication of diabetes, diarrhea, starvation. Taking certain medications can also make a person's urine pH more basic or acidic. A person should ask their doctor if they should stop taking certain medications the night or morning of a urinalysis. However, sometimes a doctor will want a person to continue taking these medications to determine a person's urine pH while they are taking them."
          }else if (ph2 > 5.1 && ph2 < 8) {
              document.ph2Form.meaning.value = "Your pH is normal."
          } else if (ph2 > 8 && ph2 < 10) {
              document.ph2Form.meaning.value = "If a person has a high urine pH, meaning that it is more alkaline, it might signal a medical condition such as: kidney stones, urinary tract infections (UTIs), kidney-related disorders. A person can also have a higher urine pH due to prolonged vomiting. This rids the body of stomach acid, which can make body fluids more basic. Acidic urine can also create an environment where kidney stones can form."
          } else {
              alert("Please Fill in everything correctly")
          }
      }
  //--></script></head><body><div class="skew-cc"></div><div class="white-block"><h1>pH of your urine</h1><form name="ph2Form"><p>Your ph (Saliva): </p> <input type="text" name="ph2" size="10"><br/><input type="button" value="Show explanation " onClick="calculatePH2()"> <br><p>Explenation:</p> <input type="text" name="meaning" size="120" style="height:150px; width:60%;"><br/><input type="reset" value="Reset"></form></body></html>

Viewing all articles
Browse latest Browse all 142239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>