Javascript qtip中的jquery表单未使用ajax提交

Javascript qtip中的jquery表单未使用ajax提交,javascript,php,jquery,ajax,qtip2,Javascript,Php,Jquery,Ajax,Qtip2,我在qtip内提交此ajax表单时遇到问题。。。它确实提交了,但忽略了e.PreventDefault(),只在浏览器中加载。此外,它没有禁用submit按钮,因此代码甚至没有被调用。我试着在success:函数和事件中运行它:。。。在这件事上任何帮助都将不胜感激 JS: PHP: 尝试在提交按钮上绑定click事件,如 editgallerysubmit.click(function() { $.ajax({ /** You ajax code */ }); return fals

我在qtip内提交此ajax表单时遇到问题。。。它确实提交了,但忽略了e.PreventDefault(),只在浏览器中加载。此外,它没有禁用submit按钮,因此代码甚至没有被调用。我试着在success:函数和事件中运行它:。。。在这件事上任何帮助都将不胜感激

JS:

PHP:


尝试在提交按钮上绑定click事件,如

editgallerysubmit.click(function() {
   $.ajax({ /** You ajax code */ });
   return false;// to prevent page reload                       
});
如果动态创建了
表单
,则需要使用绑定单击事件

// var editgallerysubmit will not work here bcoz it is dynamically created and your js rendered previously
$('#EditGallerySubmit').click(function() {
   $.ajax({ /** You ajax code */ });
   return false;// to prevent page reload                       
});

嗨,罗汉,谢谢你在这件事上花时间。我确实像你说的那样修改了代码,但是我得到了同样的效果,先生。在点击事件和渲染功能中添加了一个警报。我添加了两个警报,但没有一个出现。因此,检查控制台中是否存在任何错误,并检查您的设置渲染事件不工作的原因。是的,先生,我已经这样做了,firebug报告控制台中没有错误。类似的问题,可能的答案是:yjs,非常感谢您在这件事上花时间,我审查了你发给我的那个问题,但我没有成功地找到我正在寻找的解决方案。在我的例子中,它就像事件:甚至不起作用,因为我根据rohan的请求添加了两个警报,但它们没有弹出。
    <form id="EditGalleryForm" action="Crowork.Backend/Crowork.EditGallery.php?action=DoEditGallery&gallerykey=<?php echo $GalleryData['GalleryID']?>" method="post">
    <table border="0" width="100%">
    <tr>
        <td colspan="2" align="center"><font size="-1"><b>NOTE:</b> Letters & Numbers Only</font></td>
    </tr>
    <tr>
        <td>Name:</td>
        <td><input type="text" name="GalleryName" size="30" value="<?php echo $GalleryData['GalleryName']?>"></td>
    </tr>
    <tr>
        <td align="right" colspan="2">
            <input type="hidden" name="OriginalGalleryName" value="<?php echo $GalleryData['GalleryName']?>">
            <input type="hidden" name="GalleryID" value="<?php echo $GalleryData['GalleryID'] ?>">
            <input id="EditGallerySubmit" type="submit" name="EditGallery" value="Edit Gallery">
        </td>
    </tr>
    </table>
    </form>
    editgalleryform.bind('submit', function(e) {

                    $.ajax({
                        url: editgalleryform.attr('action'),
                        data: editgalleryform.serialize(),
                        type: 'post',
                        success: function(data, status, jqXHR) {

                        },
                        beforeSend: function() { editgallerysubmit.attr('disabled', ''); },
                        complete: function() { editgallerysubmit.removeAttr('disabled'); }
                    });

                    e.preventDefault();
            });
editgallerysubmit.click(function() {
   $.ajax({ /** You ajax code */ });
   return false;// to prevent page reload                       
});
// var editgallerysubmit will not work here bcoz it is dynamically created and your js rendered previously
$('#EditGallerySubmit').click(function() {
   $.ajax({ /** You ajax code */ });
   return false;// to prevent page reload                       
});