[Javascript] Select | Avoid changing to selected element

Peter Brunone peter at brunone.com
Mon May 15 10:39:00 CDT 2006


		Hi Simone,

   In order to do this, you're going to have to track the selected index in a variable somewhere.  Once onchange is handled, the selection has already changed, so you'll need to store the selection every time the change happens.... then, if your function returns false, you can use the old selection to reset the list.

   This seems a bit counter-intuitive, though; can you tell us more about what you are trying to accomplish?  There may be a better way.

Cheers,

Peter  

				From: Simone Fumagalli simone at tomato.it

Ciao javascript,

I've a select where on OnChange I run a function.

What I would like to do is to avoid the element changing if my
function return false.

Something like what happens with form and OnSubmit, where, if the
function called by OnSubmit return false, the form is not submitted.

Thanks in advance.

-- 
Simone - simone at tomato.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060515/22de66a0/attachment.htm>


More information about the Javascript mailing list