index.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/layout}">
  3. <head>
  4. <title>Contact Us</title>
  5. </head>
  6. <body>
  7. <div layout:fragment="content" class="ui container">
  8. <br />
  9. <h1>Contact Us</h1>
  10. <p>
  11. Fill out the form and we'll get back to you as soon as we can.
  12. </p>
  13. <form class="ui form">
  14. <div class="field">
  15. <label>Reason</label>
  16. <select class="ui fluid dropdown" id="reason">
  17. <option value="bug report">Bug Report</option>
  18. <option value="customer support">Customer Support</option>
  19. <option value="sales">Sales</option>
  20. </select>
  21. </div>
  22. <div class="field">
  23. <label>Message</label>
  24. <textarea id="comment"></textarea>
  25. </div>
  26. <div class="field">
  27. <label>Email Address</label>
  28. <input type="text" id="email" placeholder="Email Address" />
  29. </div>
  30. <a id="sendButton" class="ui green button">Send Message</a>
  31. </form>
  32. <script>
  33. $("#sendButton").click(function() {
  34. let reason = $("#reason").val();
  35. var email = $("#email").val();
  36. var comment = $("#comment").val();
  37. $.post(
  38. "/contact/",
  39. {
  40. reason: reason,
  41. email: email,
  42. comment: comment,
  43. token: token
  44. },
  45. function(result) {
  46. console.log(result);
  47. if (result.success) {
  48. alert("Thanks for posting comment.");
  49. } else {
  50. alert("You are spammer ! Get the @$%K out.");
  51. }
  52. }
  53. );
  54. });
  55. </script>
  56. </div>
  57. </body>
  58. </html>