modifying default behavior for elements
Brent repliest to my former "never rely on javascript" post, reminding us there may be legitimite uses of overriding the default behavior:
Well I'm not against that. I've written it as a reply to that post. But I think it's worth mentioning here once more:
Javascript is to enhance functionality, not to create. That's okay.
And by giving enter key an alternative function only for a particular element, you enhance the way user interacts with your form.
Moreover, Brent indicates that he has also made sure that the form works equally well without JavaScript.
So he is not obstructing anything. On the contrary he is enhancing a form element's functionality.
Modifying the default behaviour, or modifying anything for that matter, is not bad if you know what you are doing and if you have a valid and reasonable explanation for it.
Which leads us to another discussion that being a standardista does not necessarily require being a standards blind:
don't be a standards blind!
And if you're interested, here is a follow up describing the intentional non-standard exceptions I do on my site.
bu yaziyi sevdin mi?
hemen
una ekle!
This is actually the second time I've run across this entry, and I agreed with it the first time, but now I'm not so sure.
I'm in a situation where I'm being asked to disable enter on a form only under a particular circumstance. Briefly, I have a drop-down search results box, a la Google Suggest, and the powers that be want the enter key to select an option from that box, rather than attempt to submit the form. I think this is a reasonable request. The points you bring up about not using Javascript for security are completely valid, but there are cases where we might want to modify the default behavior for non-security related reasons. These ought to be taken into account.
I also want to add that this form does degrade gracefully, and that accessibility is not compromised in this scenario, because enter is only disabled while the user is performing a specific task (selected an option from the menu).
Well I'm not against that. I've written it as a reply to that post. But I think it's worth mentioning here once more:
Javascript is to enhance functionality, not to create. That's okay.
And by giving enter key an alternative function only for a particular element, you enhance the way user interacts with your form.
Moreover, Brent indicates that he has also made sure that the form works equally well without JavaScript.
So he is not obstructing anything. On the contrary he is enhancing a form element's functionality.
Modifying the default behaviour, or modifying anything for that matter, is not bad if you know what you are doing and if you have a valid and reasonable explanation for it.
Which leads us to another discussion that being a standardista does not necessarily require being a standards blind:
don't be a standards blind!
And if you're interested, here is a follow up describing the intentional non-standard exceptions I do on my site.
bu yaziyi sevdin mi?
hemen
una ekle!
- permalink: 10:01 AM


0 Coments
Post a Comment
Links to this post:
Create a Link
<< Home