Scripsit tobes:
I'm developing a web application that has contains an online
questionnaire.
Is there an URL for the latest draft page?
My client wants users to input answers in English, despite the fact
the questionnaire is in Arabic.
That's strange. Why would he want to do that?
Anyway, you should probably use UTF-8 for the page, and naturally design the
form handler so that it can process UTF-8 data. The reason is that people
_can_ input any Unicode character (if you just learn how to do that), and
strange things may and will happen if they enter a character that is not
representable in the encoding of the page, which is what gets used (at least
by default) for the form data when the browser sends it to the server.
(The 8-bit encodings commonly used for Arabic contain Latin letters as well,
but only the basic letters A to Z, and English texts may contain other
letters, too.)
If I view the page on a UK computer and type into some user input
boxes, then the input language is English regardless of what the
language of the HTML page is.
There's some confusion here. No wonder, since people regularly confuse
languages, character repertoires, encodings, fonts, and input methods with
each other, and many programs reinforce the confusion.
The language of the HTML page, as the actual language or as the language
declared in lang or xml:lang attributes, has nothing to do with the issue.
The keyboards and keyboard settings vary, and they do not depend on the
language _or_ the encoding of a web page. A user in the UK may install a
keyboard driver that turns the keyboard into Arabic and may well have done
that, unless he got a real Arabic keyboard from somewhere.
However, if using a computer in Kuwait for example, anything typed
into the boxes will be Arabic.
Are you sure? Similar considerations apply here. People can use different
keyboards and keyboard settings.
Is there a way in HTML of forcing
Of course not.
the input language on a particular element?
Not that one either.
<input type="text" xml:lang="en" lang="en" name="forename" value="" />
You have just declared that "" is in English. Even if we took the attributes
as applying to the data entered into the field (even though it is _not_
element content in the HTML sense), then the attributes would in principle
just _claim_ that the text is in English and would in practice by ignored by
any browser.
If you want to restrict input in one language, or even in some limited
character repertoire, you need to add a lot of server-side code that checks
such issues.
Technically, a <form> element could have e.g. accept-charset="us-ascii", and
it in fact may have some effect. But what it does - if it does anything - is
that the form data will be us-ascii encoded. If the actual user input
contains non-us-ascii characters, well... you wouldn't believe me if I
explained, so you'd better check yourself if you considered using this
attribute.