Skip to content

Instantly share code, notes, and snippets.

@Stefany93
Created June 21, 2019 22:08
Show Gist options
  • Save Stefany93/8e16f88ef7440ff0c4934d0c6d1d16dc to your computer and use it in GitHub Desktop.
Save Stefany93/8e16f88ef7440ff0c4934d0c6d1d16dc to your computer and use it in GitHub Desktop.
AMP contact form
<form
action-xhr="/scripts/contact_process.php"
verify-xhr="/scripts/contact_process.php"
method="post"
class="detailed_contact_form "
custom-validation-reporting="show-all-on-submit"
>
<fieldset class="user-valid valid">
<legend>
<span> Schedule an appointment</span>
</legend>
<div class="form-body">
<div class="form-group">
<div class="form-group">
<div class="form-group">
<label for="email">Email </label>
<input type="text" required name="email" id="email" value="example@example.com"class="form-input string-entry">
</div>
<label for="name">Name </label>
<input type="text" required value="Cindy" name="name" id="name" class="form-input string-entry">
</div>
<div class="form-group">
<label for="phone">Phone </label>
<input type="tel" required name="phone" id="phone" value="123-345-6789" class="form-input string-entry">
</div>
<div class="form-group">
<label for="message">Message </label>
<textarea name="message" id="message" required class="textarea" >I want to schedule an appointment for my dragon Skippy, for tomorrow 10AM</textarea>
</div>
<div class="form-group button-holder">
<input type="submit" class="button" value="Send appointment!">
</div>
</div>
<div submit-error>
<template type="amp-mustache">
{{#verifyErrors}}
<p>{{message}}</p>
{{/verifyErrors}}
{{^verifyErrors}}
<p>
Can't submit form. Please email at example@example.com
or call at 123-456-6780
</p>
{{/verifyErrors}}
</template>
</div>
<div submit-success>
<template type="amp-mustache">
Message Sent!
</template>
</div>
</fieldset>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment