Comments? Feedback?

This wiki does not yet support public comments (a limitation of Google Sites), so we encourage you to post your comments either:

On Twitter by responding to @orbeon.

On our community mailing list: subscribe sending an email to ops-users-subscribe@ow2.org (content of subject/body doesn't matter), you'll get a response with the email to use to send your message to the community mailing list.

Recent site activity

XForms - Noscript (Accessible) Mode Guide


[Documentation status: preliminary]

Availability

This is an Orbeon Forms PE feature.

Introduction

The noscript mode is a special mode of the XForms engine which produces pure HTML pages without any JavaScript. This has the following benefits:
  • Compliance with laws or regulations in certain countries, which require that certain public sites do not use JavaScript or feature an option for JavaScript-free operation.
  • Make pages friendlier with screen readers, not all of which support properly very dynamic pages.
  • Allows targeting older browsers.
  • Allows targeting users who have decided not to enable JavaScript.
Because of the declarative aspects of XForms, a same page description written in XHTML and XForms can produce an Ajax output or a noscript output, thus saving on development time.

Limitations of the noscript mode

  • There is no "as you type" validation
  • User-triggered refreshes are needed to update field validity and other dynamic behavior (calculations)
  • There are no background file uploads
  • Some richer controls (such as the rich text editor, the menu, or the tree) are not supported in noscript mode, because their implementation relies on script.
  • Which mode is used, script-enabled or noscript, is determined before the page is sent to the browser, not when the page is rendered, using graceful degradation. You'll find more details on this in the next section.

Enabling the noscript mode

You enable the noscript mode:
  • For a specific form by adding the  xxforms:noscript="true" property on the first XForms model.
  • For all the forms by adding the following property in your properties-local.xml:
<property as="xs:boolean" name="oxf.xforms.noscript" value="true"/>

The choice whether users get the noscript or script-enabled version of your form is done ahead of time, before the HTML is sent to the browser. At this point, Orbeon Forms does not support sending a page to the browser which uses JavaScript if available, and degrades to the noscript mode if JavaScript isn't available. Typically, you'll want to present users for the script-enabled version of the form first, adding a link at the top that could read "Accessible version" and that points to the noscript version of the form. If you're using Form Builder / Form Runner, this will be done automatically for you.

The benefit of this approach is that you're giving users the choice of which version to use. In some cases, users might have a JavaScript enabled browser, but prefer the noscript version because it will work better with their screen reader. The drawback is that in the rare cases where users happen to use a browser that really doesn't support any JavaScript, they will have to do an additional click on "Accessible version" before they can get a version of the form they can use.

It is also possible to disable noscript support using the oxf.xforms.noscript-support property. See the Noscript mode properties.

Writing XForms supporting the noscript mode

Use property('xxforms:noscript') in XPath: return true or false depending on whether you are in noscript mode or not.

[TODO]

Form Runner support

[TODO]

Notes

TODO:
  • Cover help
  • Controls
    • triggers as links
    • <button> with IE 6
  • Differences in handling e.g. Save button (can't disable it dynamically?)
  • Refresh button
  • Additional accessibility support (links, etc.)
  • No background uploads