{"id":344,"date":"2019-09-02T09:21:37","date_gmt":"2019-09-02T09:21:37","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/vuely\/?page_id=344"},"modified":"2019-10-19T08:31:22","modified_gmt":"2019-10-19T08:31:22","slug":"form-elements","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/vuely\/form-elements\/","title":{"rendered":"Forms"},"content":{"rendered":"\n<h6>Form Validation: <\/h6>\n\n\n\n<p>When it comes to form validation, Vuetify has a multitude of integrations and baked in functionality. Want to use a 3rd party validation plugin? Out of the box you can use <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/baianat\/Vee-validate\" target=\"_blank\">Vee-validate<\/a> and <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/vuelidate\/vuelidate\" target=\"_blank\">vuelidate<\/a>. <\/p>\n\n\n\n<p> The  <code>v-form<\/code> component makes it easy to add validation to form inputs. All input components have a <code>rules<\/code> prop which takes an array of functions. These functions allow you to specify conditions in which the field is <em>valid<\/em> or <em>invalid<\/em>. Whenever the value of an input is changed, each function in the array will receive the new value. If a function returns false or a string, validation has failed. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> <br>&lt;template&gt;<br>  &lt;v-form v-model=\"valid\"&gt;<br>    &lt;v-container&gt;<br>      &lt;v-row&gt;<br>        &lt;v-col<br>          cols=\"12\"<br>          md=\"4\"<br>        &gt;<br>          &lt;v-text-field<br>            v-model=\"firstname\"<br>            :rules=\"nameRules\"<br>            :counter=\"10\"<br>            label=\"First name\"<br>            required<br>          &gt;&lt;\/v-text-field&gt;<br>        &lt;\/v-col&gt;<br>        &lt;v-col<br>          cols=\"12\"<br>          md=\"4\"<br>        &gt;<br>          &lt;v-text-field<br>            v-model=\"lastname\"<br>            :rules=\"nameRules\"<br>            :counter=\"10\"<br>            label=\"Last name\"<br>            required<br>          &gt;&lt;\/v-text-field&gt;<br>        &lt;\/v-col&gt;<br>        &lt;v-col<br>          cols=\"12\"<br>          md=\"4\"<br>        &gt;<br>          &lt;v-text-field<br>            v-model=\"email\"<br>            :rules=\"emailRules\"<br>            label=\"E-mail\"<br>            required<br>          &gt;&lt;\/v-text-field&gt;<br>        &lt;\/v-col&gt;<br>      &lt;\/v-row&gt;<br>    &lt;\/v-container&gt;<br>  &lt;\/v-form&gt;<br>&lt;\/template&gt; <\/pre>\n\n\n\n<h6><strong>Stepper:<\/strong><\/h6>\n\n\n\n<p>The <code>v-stepper<\/code> component displays progress through numbered steps.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;template&gt;<br>  &lt;v-stepper v-model=\"e1\"&gt;<br>    &lt;v-stepper-header&gt;<br>      &lt;v-stepper-step :complete=\"e1 &gt; 1\" step=\"1\"&gt;Name of step 1&lt;\/v-stepper-step&gt;<br>      &lt;v-divider&gt;&lt;\/v-divider&gt;<br>      &lt;v-stepper-step :complete=\"e1 &gt; 2\" step=\"2\"&gt;Name of step 2&lt;\/v-stepper-step&gt;<br>      &lt;v-divider&gt;&lt;\/v-divider&gt;<br>      &lt;v-stepper-step step=\"3\"&gt;Name of step 3&lt;\/v-stepper-step&gt;<br>    &lt;\/v-stepper-header&gt;<br>    &lt;v-stepper-items&gt;<br>      &lt;v-stepper-content step=\"1\"&gt;<br>        &lt;v-card<br>          class=\"mb-12\"<br>          color=\"grey lighten-1\"<br>          height=\"200px\"<br>        &gt;&lt;\/v-card&gt;<br>        &lt;v-btn<br>          color=\"primary\"<br>          @click=\"e1 = 2\"<br>        &gt;<br>          Continue<br>        &lt;\/v-btn&gt;<br>        &lt;v-btn text&gt;Cancel&lt;\/v-btn&gt;<br>      &lt;\/v-stepper-content&gt;<br>      &lt;v-stepper-content step=\"2\"&gt;<br>        &lt;v-card<br>          class=\"mb-12\"<br>          color=\"grey lighten-1\"<br>          height=\"200px\"<br>        &gt;&lt;\/v-card&gt;<br>        &lt;v-btn<br>          color=\"primary\"<br>          @click=\"e1 = 3\"<br>        &gt;<br>          Continue<br>        &lt;\/v-btn&gt;<br>        &lt;v-btn text&gt;Cancel&lt;\/v-btn&gt;<br>      &lt;\/v-stepper-content&gt;<br>      &lt;v-stepper-content step=\"3\"&gt;<br>        &lt;v-card<br>          class=\"mb-12\"<br>          color=\"grey lighten-1\"<br>          height=\"200px\"<br>        &gt;&lt;\/v-card&gt;<br>        &lt;v-btn<br>          color=\"primary\"<br>          @click=\"e1 = 1\"<br>        &gt;<br>          Continue<br>        &lt;\/v-btn&gt;<br>        &lt;v-btn text&gt;Cancel&lt;\/v-btn&gt;<br>      &lt;\/v-stepper-content&gt;<br>    &lt;\/v-stepper-items&gt;<br>  &lt;\/v-stepper&gt;<br>&lt;\/template&gt;<\/pre>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"344\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"344\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Form Validation: When it comes to form validation, Vuetify has a multitude of integrations and baked in functionality. Want to use a 3rd party validation plugin? Out of the box you can use Vee-validate and vuelidate. The v-form component makes it easy to add validation to form inputs. All input components have a rules prop [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":35,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/pages\/344"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/comments?post=344"}],"version-history":[{"count":4,"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/pages\/344\/revisions"}],"predecessor-version":[{"id":875,"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/pages\/344\/revisions\/875"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/vuely\/wp-json\/wp\/v2\/media?parent=344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}