Skip to main content

Home/ HTML5 development/ Group items tagged form

Rss Feed Group items tagged

Vernon Fowler

HTML5 Form Validation - Showing All Error Messages - 0 views

  • an :invalid pseduoselector that can be used to select all elements with validation errors
  • only give an error for the first field
  • showing the users only the first error message is bad
  • ...2 more annotations...
  • Browsers that support HTML5 form validation have one thing in common; if a <form> is submitted and has errors on multiple fields, the browser will only display the first error to the user.
  • instead of listening for submit on the <form>, I instead listen for a click on the <input type="submit">. Since the user is also able to submit the form pressing enter in text inputs, I attach a keypress listener to them to ensure the same logic runs.
Vernon Fowler

HTML Standard - 0 views

  • The value of input elements whose type attributes are in the Text, Search, URL, or E-mail states and that are mutable (i.e. that do not have the readonly attribute specified and that are not disabled).The value of textarea elements that do not have a readonly attribute and that are not disabled.
    • Vernon Fowler
       
      Note the input types that we can set spellcheck="false" include: email url search text
  • Otherwise, if there is an ancestor element with a spellcheck content attribute that is not in the default state, then: if the nearest such ancestor's spellcheck content attribute is in the true state, then checking is enabled; otherwise, checking is disabled.
  • User agents should take into account the other semantics given in the document when suggesting spelling and grammar corrections. User agents may use the language of the element to determine what spelling and grammar rules to use, or may use the user's preferred language settings. UAs should use input element attributes such as pattern to ensure that the resulting value is valid, where possible.
Vernon Fowler

HTML5 forms input types | HTML5 Doctor - 0 views

  • Once more, the iPhone recognises type="tel", only this time it goes one step further and completely changes the keyboard to the standard phone keyboard, as shown on the left in Figure 6. In addition to the iPhone, some Android devices (such as HTC Desire, shown on the right in Figure 6) also display a numeric keyboard for type="tel". That’s pretty handy, don’t you think? Nice, big keys for entering a phone number help you to get that big, nasty form completed quickly.
  • In contrast to Opera’s implementation, the iPhone (Figure 8) and some Android devices (such as HTC Desire, shown on the right in Figure 6-13) simply render the field as a standard text box but optimize the keyboard for easy input.
  • Chris’ technique may soon become absolete though with the introduction of the inputmode attribute. The attribute, recently added to the specification will allow users to specify the type of input mechanism that is most useful for users. When implemented, you will be able to choose between numeric, latin, email, or kana input modes.
  • ...3 more annotations...
  • To make the iPhone render with the standard telephone keypad as we saw for type="text" Chris Coyier, of CSS Tricks devised a little hoax you can use. Rather than using type=”number”, use a standard type="text" input and add a pattern attribute that accepts only numbers, as shown below. This solution isn’t ideal but if you think it could be useful, Chris has put a short video together showing it in action. <input type="text" pattern="[0-9]*" name="shoe-size">
  • There are dedicated keys for the @ and . characters to help you complete the field more efficiently. As we discussed with type="search", there is no downside to using type="email" right now. If a browser doesn’t support it, it will degrade to type="text". And in some browsers, users will get a helping hand.
  • The url input type, as you might expect, is for web addresses. You can use the multiple attribute to enter more than one URL. Like type="email", a browser will carry out simple validation on these fields and present an error message on form submission. This is likely to include looking for forward slashes, periods, and spaces, and possibly detecting a valid top-level domain (such as .com or .co.uk). Use the url input type like so: <input type="url" name="url" required>
Vernon Fowler

Relevant Dropdowns: Polyfill for Datalist | CSS-Tricks - 0 views

  •  
    "The list attribute / datalist element of HTML5 forms is pretty cool. As you type in a text input, it shows you a dropdown menu of choices you can pick from. Or you can type in whatever you want. The list attribute alone doesn't lock you into any specific value. In that way, it's a bit like a group of radio buttons with an "other" type-in option."
Vernon Fowler

What's New in HTML 5.2? - 0 views

  • Headings in a <legend> In forms, the <legend> element represents a caption for the form fields within a <fieldset>. Before HTML 5.2, the content of a legend had to be plain text. Now, we can include heading elements.
Vernon Fowler

Can I use... Form validation - 0 views

  •  
    What HTML5 features are currently supported by each browser
Vernon Fowler

:required | CSS-Tricks - 0 views

  • The :required attribute works on radio buttons. If you put required on one radio button (or all), that particular group of radio buttons will be required. On checkboxes, makes each individual checkbox required (to be checked).
Vernon Fowler

: The Input (Form Input) element - HTML | MDN - 0 views

  • A single-line text field for entering search strings.
    • Vernon Fowler
       
      On mobile devices with on-screen keyboards, the search input type sets the submit button text to "Search". On desktop devices, this should also enable submitting the form by pressing the Enter key?
  • Possible values are: off: The user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method. The browser does not automatically complete the entry. on: The browser is allowed to automatically complete the value based on values that the user has entered during previous uses, however on does not provide any further information about what kind of data the user might be expected to enter. name: Full name. honorific-prefix: Prefix or title (e.g. "Mr.", "Ms.", "Dr.", "Mlle"). given-name: First name. additional-name: Middle name. family-name: Last name.
  • inputmode
    • Vernon Fowler
       
      Currently not supported in any browser. https://caniuse.com/#feat=input-inputmode
  • ...4 more annotations...
  • This attribute applies when the value of the type attribute is text, search, tel, url, email, or password, otherwise it is ignored.
  • minlength HTML5 If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the minimum number of characters (in Unicode code points) that the user can enter.
  • maxlength If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the maximum number of characters (in UTF-16 code units) that the user can enter.
  • autocorrect A Safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. Permitted values are: on Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
Vernon Fowler

Semantic navigation with the nav element | HTML5 Doctor - 1 views

  • Previous/next buttons (or pagination) I would say yes to this because it is important to the overall structure and hierarchy of the blog/site
  • Search form For me, a definite yes, but it is not mentioned in the spec. A search form is hugely important to the navigation of a site, particularly large sites which rely almost solely on their search engine.
  • Breadcrumbs Again, I would say yes to this as well. Although breadcrumbs are not always necessary and can be used when not applicable, on large sites a breadcrumb trail can be an important navigation aid.
  • ...3 more annotations...
  • <menu> is to be used for a list of commands and is an interactive element and more likely to be used exclusively in Web Applications.
  • The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links.
  • Table of Contents I would say definitely yes to that – it is primary navigation for that particularly content
  •  
    Breadcrumbs Again, I would say yes to this as well. Although breadcrumbs are not always necessary and can be used when not applicable, on large sites a breadcrumb trail can be an important navigation aid.
Vernon Fowler

HTML5 Tutorial - Web form 2.0 - 0 views

  • New Input attributes <input type="text" "new input attribute"/> Placeholder Autofocus Required
  • New input types <input type="new input type"/> Search Email, URL and Phone
  • Number as Spinner
Vernon Fowler

HTML5 Forms: Search Type Demo | Wufoo - 0 views

  • The results and autosave attributes shown above are not standard. In WebKit and Blink browsers you can add the non-standard results attribute to get a looking glass icon to click to see the latest searches, and autosave to keep them across page loads.
  • When a value is present, a gray x control shows up on the right of the input in IE, Chrome, Safari and Opera (but not Firefox or Chrome on Android) which can be clicked to clear the value.
Vernon Fowler

15 HTML5 tutorials which will make you a wow designer - 0 views

  •  
    #HTML5 Tutorials That Every #WebDesigner Should See http://t.co/k1Xh4VEO @ahrefmag
Vernon Fowler

Email Domain Datalist Helper | CSS-Tricks - 0 views

  •  
    "What if someone signs up for your web app and they type in their email address as susan_smith@gmaoil.com? They don't notice, they never get their confirmation email, they never can log in again, the "forgot password" feature doesn't work, and there is a lot of frustration and finger pointing."
Vernon Fowler

- HTML: Hypertext Markup Language | MDN - 0 views

  • A string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max).
  • <input type="number"> elements do not support use of the pattern attribute for making entered values conform to a specific regex pattern.
  • inputs of type number support these attributes
  •  
    " elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries. The browser may opt to provide stepper arrows to let the user increase and decrease the value using their mouse or by simply tapping with a fingertip."
1 - 18 of 18
Showing 20 items per page