HTMX Contact Form

Contact.html




Htmx is a dependency-free javascript library.

It can be used via NPM as "htmx.org" or downloaded or included from unpkg or your other favorite NPM-based CDN:

<script src="https://unpkg.com/htmx.org@1.6.0"></script>


{% block content %}
<div class="container my-3">
    <h3>Welcome to noBin Contact Us</h3>
    <form hx-post="/contact" hx-target="body" method="post">
    {% csrf_token %}
      <div class="form-group my-2">
        <label for="name">Name</label>
        <input type="text" class="form-control" id="name" name="name"aria-describedby="name">
      </div>
   
      <div class="form-group my-2">
        <label for="email">Email address</label>
        <input type="email" class="form-control" id="email" name="email" aria-describedby="emailHelp">
        <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
      </div>
   
      <div class="form-group my-2">
        <label for="phone">Phone Number</label>
        <input type="tel" class="form-control" id="phone" name="phone">
      </div>
   
      <div class="form-group my-2">
        <label for="content">Describe your issue :</label>
        <textarea class="form-control" name="content" id="content" cols="30" rows="5"></textarea>
      </div>
   
   
      <button type="submit" class="btn btn-danger">Submit</button>
     
    </form>
    </div>
{% endblock %}

Share your thoughts

Previous Post Next Post

نموذج الاتصال