Re: [PHP] dynamic lists



# jochem@xxxxxxxxxxxxx / 2007-01-17 23:20:23 +0100:
Kevin Murphy wrote:
On Jan 17, 2007, at 1:39 PM, Brad Fuller wrote:
#1) Submit the form (to itself) when a user chooses an option from the
first list (using onChange=form.submit()) then with PHP query the
database for the second set of options.

#2) Use JavaScript to store all the values and pop them in when the user
chooses an option from the first list (using onChange=someFunction(...)).

I like #2. If you need a starting point, google for "javascript dynamic
select list"

FYI... Neither #1 or #2 are considered good practice for
Accessibility/ADA compliance. If you are using a keyboard or screen
reader to view your website, it will always pick the first one in the
list and you won't have the option of even seeing the rest of the list.
Basically, anything that uses onchange or onselect will cause
accessibility issues. The only way to accomplish this is using onclick
or submitting the form.

that stance basically negates everything 'ajax', flash, video and everything
considered to be remotely 'web2.0' - is the 'low-common-denominator' case
always the correct choice?

And what about the my-ajax-is-longer-than-your-ajax (or whatever's "in"
right now (is "in" still a "cool" word?)) lemming-march mentality?

I understand the importance of accessibility but the practicality of most
peoples' job in this sector means satisfying the requirements of a client
that demands such dynamic functionality such as the auto-selection example
given here.

That's typically a result of poor user requirements capture. :)

is there not an argument that screen-reader and [braille] keyboard software
are somwhat responsible for being capable of 'keeping up' - given that an
onclick can be handled why not an 'onchange' (in theory)?

Yeah, wheelchairs can move along a sidewalk, so what's stopping them
from walking up and down stairs? If you haven't written an open source
browser on par with mozilla for blind people, it's IMO polite to not
raise the bar for them unless necessary. KISS and all that.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
.



Relevant Pages

  • Re: Cannot use href="javascript:a_function()"
    ... In my original set of testing I had never considered simply javascript:; as an option but having played with it, it works the same at least in FF3, IE6 and IE7. ... How is the same done when the onclick is assigned directly in the HTML markup? ... Thats fine in IE but lets say we want access the event object during the function call, IE has a global event object but Mozilla doesn't. ...
    (microsoft.public.scripting.jscript)
  • Re: with only one
    ... hidden variables carefully set to get the desired action depending on ... There are several lists, all with one or more options..I need to select ONE item from ALL the lists and go with that. ... The javascript associated with the onchangeor onclick() stuff does indeed patch in a value to a hidden variable anyway. ...
    (comp.lang.javascript)
  • Re: Nasty Firefox problem with history.back()
    ... I too tried to put the onClick into the image line: ... javascript - no code runs in that case. ... to consider your site design and make sure that those ... Rollovers can just get dropped entirely. ...
    (comp.lang.javascript)
  • Re: Trouble adding an OnClick Dynamically.
    ... supposed to hide javascript from the validator. ... onclick handler won't have been added. ... will often press Esc several times to cancel loading then try to use the ... both RobG and Mr Winter for pointing that out. ...
    (comp.lang.javascript)
  • Re: I dont get javascript. How do you use it?
    ... Whether or not you capiatalize the "c" in onClick does not matter in the ... HTML button because HTML is not a case-sensitive language. ... I'm on my way now to practicing and learning more about javascript and i ... the OnClick event of a server control is a server event. ...
    (microsoft.public.dotnet.framework.aspnet)

Loading