|
Posted by Jonathan N. Little on 06/25/06 15:26
Martin Jay wrote:
> In message <Cqe9lxJavonEFwwt@spam-free.org.uk>, Martin Jay
> <martin@spam-free.org.uk> writes
>> In message <ce7ee$449e159b$40cba7c7$8381@NAXS.COM>, Jonathan N. Little
>> <lws4art@centralva.net> writes
>>> Event handlers attached by 'addEventListener' do not seem to pass
>>> values in time to cancel form submission unlike the methods that it is
>>> supposed to replace. In an attempt to keep the markup as clean as
>>> possible, I add the handlers from the attached javascript page and I
>>> have noticed the trouble. Small demo to illustrate:
>>>
>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>>> "http://www.w3.org/TR/html4/strict.dtd">
>>> <html><head><title>Attached Events</title>
>>>
>>> <script type="text/javascript">
>>> function cancelIt(){
>>> alert("This should cancel the form submission");
>>> return false;
>>> }
>> PreventDefault();
>>
>> There's some information about it and the IE alternative at:
>> <http://www.howtocreate.co.uk/tutorials/javascript/domevents>
>
> And in particular this near the bottom of the page:
>
> "Preventing the default action"
>
> Looks like it does what you want.
Thanks Martin, right on where the problem lies... The damn thing about
it this not only is it necessary to create a fork in the code to
accommodate IE in attaching the event, but I either have to have to
create two separate functions (an IE function and the rest of the web
browsers function) or fork the code in the in the function itself! There
are times when I'd like to tell Bill where he can stick his IE.
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|