I figured it out. All I had to do was move this part to the very end
of the page.

<script type="text/javascript" >
// prepare the form when the DOM is ready
$(document).ready(function() {
// bind form using ajaxForm
$('#msg_form').ajaxForm({
// target identifies the element(s) to update with the server response
target: '#sender',

// success identifies the function to invoke when the server response
// has been received; here we apply a fade-in effect to the new
content
success: function() {
$('#sender').fadeIn('slow');
}
});
});

</script>

On Feb 20, 9:00 pm, jfornear <jesseforn...@gmail.com> wrote:
> I'm displaying a form in a Thickbox and using the jQuery form plugin
> to process the form and load the results back into the same Thickbox
> window.
>
> It's working perfectly in Firefox, but when the form is submitted in
> Chrome/Safari you are sent to the page in the action attribute.
>
> This is the js in the Thickbox ajax content: (jquery.js is linked on
> the original page that loads the Thickbox inside it.)
>
> <script src="js/jquery.form.js" type="text/javascript"
> charset="utf-8"></script>
> <script type="text/javascript" >
> // prepare the form when the DOM is ready
> $(document).ready(function() {
> // bind form using ajaxForm
> $('#msg_form').ajaxForm({
> // target identifies the element(s) to update with the server response
> target: '#sender',
>
> // success identifies the function to invoke when the server response
> // has been received; here we apply a fade-in effect to the new
> content
> success: function() {
> $('#sender').fadeIn('slow');}
> });
> });
>
> </script>
>
> HTML in the Thickbox ajax content:
>
> <div id="sender">
> <form id="msg_form" action="sender.php" method="post">
> <input type="hidden" name="msg" value="lorem ipsum" />
> <input type="submit" value="submit" />
> </form>
> </div>
>
> In Firefox, this works perfectly and loads the results from sender.php
> in #sender inside the original Thickbox. In Chrome/Safari it just
> sends you to sender.php.

Reply via email to