Published on 2006-03-01 14:44:08

Danne posted a very interesting article about Accessible forms and unobtrusive javascript, where he talk about his experience to developp accessible AJAX forms where user don't have to use mouse at all. Inspite of having :

<a href="#" onclick="myaction()" accesskey="m">My action</a>


He used :

<a href="#" id="myaction" accesskey="m">My action</a>

var sheetRules = {
    '#myaction': function(el) {
        el.onclick = handleMyAction;
    }
Behaviour.register(sheetRules);


I usually try to separate backend logic from the user interface logic when creating new PHP applications. I am pro fat gui and usually have a lot of client side scripting going on. I mostly use AJAX or other remote scripting techniques to call actions defined in the PHP backend. In my latest PHP project, a timesheet application (because all the ones I find are crappy), I went for a really accessible user interface. An interface where you don't have to use the mouse for everything.

I don't want any PHP mixed with my html. I don't want javascript in there either which is why I like the unobtrusive way of adding javascript to my applications. So behaviour fits right into my world. Normally you scatter lots of onclick and other event handling attributes in the html like below.


Related Entries

Member of the PHP Magazine Network, Copyright (C) 2005-2008 phpmagazine.net All Rights Reserved