Skip to content

Latest commit

 

History

History
69 lines (57 loc) · 2.03 KB

contact.md

File metadata and controls

69 lines (57 loc) · 2.03 KB
layout title description permalink
page
Contact
Let's talk.
/contact/
<style type="text/css" media="screen"> .container { margin: 0px auto; max-width: 600px; } </style>

Talk to me

    <input type="text" name="name" placeholder="Your name" v-validate="'required'"
           :class="{ 'has-error': errors.has('name') }">
    <span v-if="errors.has('name')" v-cloak>${ errors.first('name') }</span>

    <input type="text" name="email" placeholder="Your e-mail" v-validate="'required|email'"
           :class="{ 'has-error': errors.has('email') }">
    <span v-if="errors.has('email')" v-cloak>${ errors.first('email') }</span>

    <textarea name="message" onkeyup="adjust_textarea(this)" placeholder="Your message" v-validate="'required'"
              :class="{ 'has-error': errors.has('message') }"></textarea>
    <span v-if="errors.has('message')" v-cloak>${ errors.first('message') }</span>

    <button type="submit">Send</button>
  </fieldset>
</form>
<script type="text/javascript"> function adjust_textarea(h) { h.style.height = "200px"; h.style.height = (h.scrollHeight)+"px"; } </script> <script src="https://unpkg.com/[email protected]"></script> <script src="https://unpkg.com/[email protected]"></script> <script type="text/javascript"> Vue.use(VeeValidate); new Vue({ el: '#form', delimiters: ['${', '}'], methods: { validateBeforeSubmit: function () { this.$validator.validateAll(); if (!this.errors.any()) { this.$refs.contact.submit(); } } } }); </script>