views:

53

answers:

2

when pressing the submit button text doesn't update..Not even the loading box does appear on IE... in firefox everything works excellent!

    $(".form_edit_review").live('submit', function(e){
    e.preventDefault();
    $submittingForm = $(this);
    loading("Updating...");
    postData = $submittingForm.serialize();
    $.post('/review/update', postData, function(xml){
        closeBoxy();
        var success = $("success", xml).text();
        var message = $("message", xml).text();
        if (success == "false")
        {                
            boxy_alert(message);                            
        } 
        else
        {
            $submittingForm.hide().parents("div.resto_review_bg").find(".review_text").html($submittingForm.find("textarea").val()).show();
        }
    });
});

the html code :

                        <form class="form_edit_review" id="formEditReview_<?php echo $row['review_id']?>" style="display: none;">
                        <textarea name="content" style="border: 1px solid #C2C2C2; padding: 10px; width: 547px; height: 45px;"><?php echo $row['review'];?></textarea>
                        <input type="hidden" value="<?php echo $row['review_id']?>" name="id" />
                        <input type="hidden" value="<?php echo $row['resto_id']?>" name="restoid" />

                        <p style="margin-top: 5px;">
                            <input class="btn_comment btn_update" value="Update" type="submit" />
                            <input class="btn_comment btn_cancel" value="Cancel" type="button" />
                        </p>
                    </form>
+3  A: 

From the jQuery documentation on submit:

The JavaScript submit event does not bubble in Internet Explorer. However, scripts that rely on event delegation with the submit event will work consistently across browsers as of jQuery 1.4, which has normalized the event's behavior.

The live method relies on bubbling, so it won't work with jQuery earlier than 1.4. If you use regular binding ($(".form_edit_review").submit(....)) on the form, it should work with all versions.

interjay
A: 

Problem solved!

live doesn't support submit! i changed live with bind and works excellent.

NikosV