Skip to content

Instantly share code, notes, and snippets.

@fjunior87
Last active July 30, 2016 19:23
Show Gist options
  • Save fjunior87/bc8c834bc0c1d96dbe74947e87e00305 to your computer and use it in GitHub Desktop.
Save fjunior87/bc8c834bc0c1d96dbe74947e87e00305 to your computer and use it in GitHub Desktop.
Simple Contact Form leveraging the Sling Post Servlet
<form action="/content/contactsapp/contacts/*" method="post" enctype="multipart/form-data">
<fieldset class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="Enter your name" name="name">
</fieldset>
<fieldset class="form-group">
<label for="email">Email address</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
<small class="text-muted">We'll never share your email with anyone else.</small>
</fieldset>
<fieldset class="form-group">
<label for="address">Address</label>
<input type="text" class="form-control" id="address" placeholder="Enter your name" name="address">
</fieldset>
<fieldset class="form-group">
<label for="phone">Phone</label>
<input type="text" class="form-control" id="phone" placeholder="Enter your phone" name="phone">
</fieldset>
<fieldset class="form-group">
<label for="contactImage">File input</label>
<input type="file" class="form-control-file" id="contactImage" name="contactImage">
</fieldset>
<input type="hidden" name=":redirect" value="/content/contactsapp.html" />
<button type="submit" class="btn btn-primary">Submit</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment