[thelist] JS Drop-Down Nav

.jeff jeff at members.evolt.org
Tue Jan 29 03:26:00 CST 2002


stef,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: DESCHAMPS Stephane DvSI/SICoR
>
> I think I'd rather use <form onsubmit="gotoFunction()">
> than <input onclick="gotoFunction()">.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

yeah, same here.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Just in case the user presses the <Enter> key (see the
> other thread about submitting forms with <Enter>).
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

but not for the reason you mention.  you see, there's not a browser i know
of that will submit a form with the "enter" key when a <select> has focus.
i'd rather do it because i like to be consistent with where i place my
function calls when submitting forms.

i'd alter slightly how i call the function though.  i'd be sure to include a
"return false" after the function call to cancel the actual submission of
the form.

<form
 onsubmit="gotoFunction(); return false">

additionally, i'd make sure to include an "action" attribute that pointed at
a valid server-side solution that took the value passed from the selected
<option> and performed a server-side redirect for the non-js users.

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/





More information about the thelist mailing list