I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/an...nsubmit-safari but not as detailed as I will.
Let me illustrate the problem with examples.
The HTML:
Expand|Select|Wrap|Line Numbers
- <html>
- <head>
- <script type="text/javascript" src="/js/mootools_1_11.js"></script>
- <script type="text/javascript">
- function postForm(f, c) {
- // $(f).send({onComplete: c});
- return false;
- }
- </script>
- </head>
- <body>
- <form method="post" action="other_page.html" onsubmit="return postForm(this,function(t){alert(t.length);});">
- <input type="text" name="oele" value="boele" />
- <input type="submit" value="Submit" />
- </form>
- </body>
- </html>
So I thought, maybe returning false just isn't enough SOMETIMES (because obviously sometimes it IS enough). So Mootools has a stop function for events (where the submit is the event). So I added this to the postForm function:
Expand|Select|Wrap|Line Numbers
- new Event(window.event).stop();
Expand|Select|Wrap|Line Numbers
- function postForm(f, c) {
- new Event(window.event).stop();
- $(f).send({onComplete: c});
- return false;
- }
Does anyone know the problem and a solution? It doesn't have to be pretty, but it has to be possible with Mootools. Thanks a bunch