prevalue_set.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Set PreValue</title>
  5. <meta charset="utf-8">
  6. <style>
  7. h1 {font-size: 2em;}
  8. h2 {font-size: 1.5em;}
  9. h3 {font-size: 1.2em;}
  10. p {font-size: 1em;}
  11. div {
  12. width: 200px;
  13. padding: 10px 5px;
  14. display: inline-block;
  15. border: 1px solid #ccc;
  16. font-size: 16px;
  17. max-height: 35px;
  18. }
  19. input[type=number] {
  20. width: 125px;
  21. padding: 10px 5px;
  22. display: inline-block;
  23. border: 1px solid #ccc;
  24. font-size: 16px;
  25. }
  26. .button {
  27. padding: 10px 20px;
  28. width: 211px;
  29. font-size: 16px;
  30. }
  31. </style>
  32. </head>
  33. <script src="/jquery-3.5.1.min.js"></script>
  34. <script>
  35. $ (document).ready(function() {
  36. $("#prevalue").load("/setPreValue.html");
  37. });
  38. </script>
  39. <script>
  40. function setprevalue() {
  41. var inputVal = document.getElementById("myInput").value;
  42. inputVal = inputVal.replace(",", ".");
  43. _value = "<object data=" + "/setPreValue.html?value=" + inputVal + " ></object>";
  44. document.getElementById("result").innerHTML=_value;
  45. // location.reload();
  46. }
  47. </script>
  48. <body style="font-family: arial; padding: 0px 10px;">
  49. <h3>Set the previous value for consistency check and substitution for NaN</h3>
  50. <table style="width:100%">
  51. <tr>
  52. <h2>Current Value:</h2><p>
  53. <div id="prevalue"></div>
  54. </tr>
  55. <tr>
  56. <h2>Set Value:</h2><p>
  57. Input (Format = 123.456):<p>
  58. PreValue:
  59. <input type="number" id="myInput" name="myInput"
  60. pattern="[0-9]+([\.,][0-9]+)?" step="0.001"
  61. title="This should be a number with up to 4 decimal places.">
  62. <p></p>
  63. <button class="button" type="button" onclick="setprevalue()">Set PreValue</button>
  64. </tr>
  65. <tr>
  66. <h2>Result:</h2><p>
  67. <div id="result" readonly></div>
  68. </tr>
  69. </table>
  70. </body></html>