Technique: accessible scripts...

I was asked (for the lotsth time) today how to do an accessible version of
validation scripts. I couldn't find one in the techniques, so I scribbled the
following as an answer... (slightly edited)

<form>
...
<script type="javascript" src="valider.js">
function valider() { faire le validation et submit }
<noscript>
<input type="hidden" name="validated" value="no">
</noscript>
</script>

<input type="submit" onclick="valider()" ...>



------------------
On the server when the page is submitted:

if (validated=="no") { valider() }
else { reserver() }

valider() {

if (informationIsValid) { reserver() }
else { sendBackThePageWithErrorMessages() }

}

An example of how to do this is what happens if you try to sign up for an
email address at Yahoo.com, and don't give enough information.

(I am sure there are zillions of other good examples, but that one was what
we tried and it was pretty clear and well presented in my 3-second opinion)

cheers

Charles McCN

Received on Monday, 20 November 2000 07:12:09 UTC