Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
3.3 KiB

  1. <div class='col-md-8'>
  2. <!--Form with header-->
  3. <form action="/contact" method="post">
  4. <div class="card border-primary rounded-0">
  5. <div class="card-header p-0">
  6. <div class="bg-info text-white text-center py-2">
  7. <h3><i class="fa fa-envelope"></i>Contact Me</h3>
  8. <p class="m-0">I would love to hear from you.</p>
  9. </div>
  10. </div>
  11. <div class="card-body p-3">
  12. <!--Body-->
  13. <div class="form-group">
  14. <div class="input-group mb-2">
  15. <div class="input-group-prepend">
  16. <div class="input-group-text"><svg id="i-user" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  17. <path d="M22 11 C22 16 19 20 16 20 13 20 10 16 10 11 10 6 12 3 16 3 20 3 22 6 22 11 Z M4 30 L28 30 C28 21 22 20 16 20 10 20 4 21 4 30 Z" />
  18. </svg></div>
  19. </div>
  20. <input type="text" class="form-control" id="name" name="name" placeholder="Name" required>
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <div class="input-group mb-2">
  25. <div class="input-group-prepend">
  26. <div class="input-group-text"><svg id="i-mail" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  27. <path d="M2 26 L30 26 30 6 2 6 Z M2 6 L16 16 30 6" />
  28. </svg></div>
  29. </div>
  30. <input type="email" class="form-control" id="email" name="email" placeholder="example@gmail.com" required>
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <div class="input-group mb-2">
  35. <div class="input-group-prepend">
  36. <div class="input-group-text"><svg id="i-msg" viewBox="0 0 32 32" width="32" height="32" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  37. <path d="M2 4 L30 4 30 22 16 22 8 29 8 22 2 22 Z" />
  38. </svg></div>
  39. </div>
  40. <textarea class="form-control" placeholder="Message" name="message" required></textarea>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <div class="g-recaptcha" data-sitekey="6LceWF8UAAAAAIsd7F6iY_Pywt4fJsJlFNPtEgi9"></div>
  45. </div>
  46. <div class="text-center">
  47. <input type="submit" value="Send" class="btn btn-info btn-block rounded-0 py-2">
  48. </div>
  49. </div>
  50. </div>
  51. </form>
  52. </div>
  53. <br>
  54. <br>
  55. <script src='https://www.google.com/recaptcha/api.js'></script>
  56. <script>
  57. $("form").submit(function(event) {
  58. var recaptcha = $("#g-recaptcha-response").val();
  59. if (recaptcha === "") {
  60. event.preventDefault();
  61. alert("Please check the recaptcha");
  62. }
  63. });
  64. </script>