[WEB4LIB] Re: drop-down menu query

Thomas Dowling tdowling at ohiolink.edu
Thu Jul 11 09:36:32 EDT 2002


At 09:17 AM 7/11/2002, Patty Bradley wrote:
>--On Thursday, July 11, 2002 6:02 AM -0700 Thomas Dowling
><tdowling at ohiolink.edu> wrote:
>
> > [May I recommend that you start by tweaking the code so that it works on
> > browsers with Javascript turned off?  As it is, some non-negligible
> > percentage of your users cannot use these menus at all.]
>
>I believe that the only way to accomplish this is to associate a submit
>button with each drop down menu, and remove the javascript. Each drop-down
>menu will be a separate form in the code. Please correct me if I am wrong.


Write good HTML and things are accessible by default.  Valid markup 
requires an action for the form, and good authorship adds a submit button.

It is not necessary to remove the Javascript, so exactly the same 
functionality can be retained for JS users.  It is necessary to have a 
server-side script that will do the necessary redirection as the non-JS 
fallback.

<form action="redirector.cgi" method="get">
   <p><select name="selected_item" onchange="submit(this.form)">
     <option>Apples</option>
     <option>Bananas</option>
     <option>Cherries</option>
     <option>D'Anjou Pears</option>
   </select></p>
   <noscript> <!-- If you want to get fancy -->
     <p><input type="submit" value="Go!"></p>
   </noscript>
</form>


As a less attractive alternative (IMO), you could use JS document.write 
statements to write out the current form and use the noscript element 
either to write out the links or to write one link to a standalone list of 
the links on another page.


Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu




More information about the Web4lib mailing list