Form Validation
Implementation
Show code
HTMLOpenTagform class="validate-form"HTMLCloseTag HTMLOpenTagdivHTMLCloseTag HTMLOpenTaglabel class="flex flex-col sm:flex-row"HTMLCloseTag Name HTMLOpenTagspan class="sm:ml-auto mt-1 sm:mt-0 text-xs text-gray-600"HTMLCloseTagRequired,at least 2 charactersHTMLOpenTag/spanHTMLCloseTag HTMLOpenTag/labelHTMLCloseTag HTMLOpenTaginput type="text"name="name"class="input w-full border mt-2"placeholder="John Legend"minlength="2"requiredHTMLCloseTag HTMLOpenTag/divHTMLCloseTag HTMLOpenTagdiv class="mt-3"HTMLCloseTag HTMLOpenTaglabel class="flex flex-col sm:flex-row"HTMLCloseTag Email HTMLOpenTagspan class="sm:ml-auto mt-1 sm:mt-0 text-xs text-gray-600"HTMLCloseTagRequired,email address formatHTMLOpenTag/spanHTMLCloseTag HTMLOpenTag/labelHTMLCloseTag HTMLOpenTaginput type="email"name="email"class="input w-full border mt-2"placeholder="example@gmail.com"requiredHTMLCloseTag HTMLOpenTag/divHTMLCloseTag HTMLOpenTagdiv class="mt-3"HTMLCloseTag HTMLOpenTaglabel class="flex flex-col sm:flex-row"HTMLCloseTag Password HTMLOpenTagspan class="sm:ml-auto mt-1 sm:mt-0 text-xs text-gray-600"HTMLCloseTagRequired,at least 6 charactersHTMLOpenTag/spanHTMLCloseTag HTMLOpenTag/labelHTMLCloseTag HTMLOpenTaginput type="password"name="password"class="input w-full border mt-2"placeholder="secret"minlength="6"requiredHTMLCloseTag HTMLOpenTag/divHTMLCloseTag HTMLOpenTagdiv class="mt-3"HTMLCloseTag HTMLOpenTaglabel class="flex flex-col sm:flex-row"HTMLCloseTag Age HTMLOpenTagspan class="sm:ml-auto mt-1 sm:mt-0 text-xs text-gray-600"HTMLCloseTagRequired,integer only &maximum 3 charactersHTMLOpenTag/spanHTMLCloseTag HTMLOpenTag/labelHTMLCloseTag HTMLOpenTaginput type="number"name="age"class="input w-full border mt-2"placeholder="21"requiredHTMLCloseTag HTMLOpenTag/divHTMLCloseTag HTMLOpenTagdiv class="mt-3"HTMLCloseTag HTMLOpenTaglabel class="flex flex-col sm:flex-row"HTMLCloseTag Profile URL HTMLOpenTagspan class="sm:ml-auto mt-1 sm:mt-0 text-xs text-gray-600"HTMLCloseTagOptional,URL formatHTMLOpenTag/spanHTMLCloseTag HTMLOpenTag/labelHTMLCloseTag HTMLOpenTaginput type="url"name="url"class="input w-full border mt-2"placeholder="https://google.com"HTMLCloseTag HTMLOpenTag/divHTMLCloseTag HTMLOpenTagdiv class="mt-3"HTMLCloseTag HTMLOpenTaglabel class="flex flex-col sm:flex-row"HTMLCloseTag Comment HTMLOpenTagspan class="sm:ml-auto mt-1 sm:mt-0 text-xs text-gray-600"HTMLCloseTagRequired,at least 10 charactersHTMLOpenTag/spanHTMLCloseTag HTMLOpenTag/labelHTMLCloseTag HTMLOpenTagtextarea class="input w-full border mt-2"name="comment"placeholder="Type your comments"minlength="10"requiredHTMLCloseTagHTMLOpenTag/textareaHTMLCloseTag HTMLOpenTag/divHTMLCloseTag HTMLOpenTagbutton type="submit"class="button bg-theme-1 text-white mt-5"HTMLCloseTagRegisterHTMLOpenTag/buttonHTMLCloseTag HTMLOpenTag/formHTMLCloseTag