jQuery UI Dialog showing, but form behind still submitting without user interaction

I'm having a strange issue that I've never encountered before. I have a partial view that contains additional buttons for the page it's called from, which are simply: These are additions to other buttons on the page called the same thing. The other buttons are used for simple submits - saving the form content in 2 different ways, but these two bring up a jQuery Dialog, however, the dialogs show fine, but the form instantly submits when they've loaded. Here's my dialog code: $('#editorApproveBtn').button().click(function () { $("#confirmApproveDialog").dialog({ bgiframe: true, height: 200, modal: true, resizable: false, width: 400, buttons: { 'Yes': function () { $(this).submit(); return false }, 'No': function () { $(this).dialog("close"); } } }); }); I've not a clue what's going on, I've never seen or heard of this behaviour with it before. Has anyone else had this issue or know of a way to fix it? or have I made a mistake and it's caused it? Thanks in advance for any help.

以上就是jQuery UI Dialog showing, but form behind still submitting without user interaction的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏