[Drupalcon 2012] Session Notes: Webform—the survey tool for Drupal

Presenter: Nathan Haug

Nifty stuff in Webform 3:

  • Webform-enable any content type
  • Download web form results as CSV, Excel
  • Multi-page forms
  • User-editable email templates
  • Save as Draft and Resume (only works for logged in users)
  • Save automatically between pages
  • Total and per-user submission limits (you can only submit X number of things total tracked by IP and cookies)
  • Tons of APIs for hacking; APIs like whoa
    • Means many additional modules that integrate
    • Rules integration is good
    • Panels integration also

NEW features:

  • added HTML5-friendly field elements (email, phone, etc.)
    • Important advantages for mobile devices
    • Also offers browser validation on latest versions of Chrome, Firefox
    • quirksmode.org/html5/inputs.html
    • Backwards-compatible: any browser that doesn't get it treats it like a normal text field
  • Number component
    • Force users to input integers or decimals
    • Also an HTML5 element
    • Gives you a new keyboard on mobile
    • Can show pages, fields, etc. based on the value of another field in the form
    • UI isn't great, but it is functional
    • Logic is currently limited to multipage forms
    • Webform Conditional (http://drupal.org/project/webform_conditional) offers functionality for single-page forms
  • Download range options
    • Can download a subset of results instead of all results
    • Remembers how many submissions you've downloaded since last time; only downloads the submissions you haven't downloaded yet

Tips and Tricks

  • You can clone and export web forms
  • Only fields clone; results don't copy over
  • Options Element (http://drupal.org/project/options_element) helps make it easier to create select boxes
  • Use hidden fields to display information that only administrators can see
    • e.g. track page they're on when they send the form
  • Use %get tokens to set default values—can get information from the URL and set it as the default value of the field
  • Use MIME mail to send attachments and HTML emails with Webform

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <img> <h1> <h2> <h3> <h4>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.