At the page above, at the bottom, there is a button that says "E-mail Seller". This loads a small contact form in a jQuery fancyBox (lightbox).
The following script (form-handler.js) is meant to handle the form to and from the form-handler.php.
var action = $(this).attr('action');
document.getElementById('message').innerHTML = data;
//if(data.match('success') != null) $('#contactform').slideUp('slow');
Everything works fine in Firefox, IE and Chrome. However in Safari, it's like the contents of form-handler.js are not there, its not doing anything. Using Safaris dev tools you can clearly see the script has loaded fine.
Any help would be greatly appreciated.
Personally rather then using return false i would use the following to prevent the form running its normal action event.
That is the only thing i can see that would let the form continue normally.
Zing. Unfortunately modifying my code like you suggested did not help. Everything still works fine in all browsers except Safari.
Okay try this
That fixed it!!! You da man!
Thanks a lot for you help.
Any chance you can help me understand why this works?
When i looked at how your modal window worked i saw Ajax requests which inputted the form that everyone sees, once i saw that i said to use the .live() method because it seeks out DOM elements that are not part of the original DOM structure where as the .submit() method can only seek out DOM elements that are part of the pre-existing DOM.
I had the same trouble when i first started with Ajax and form submissions but after a while you start to understand what works better with Ajax.
Awesome. Thanks a lot. I really appreciate your help.