English 中文(简体)
页: 1 彩礼
原标题:jQuery ui confirm dialog on multiple forms

我在同一页上有几张表格,我想用同一代码向所有人补充确认的辩词。 他们都有一类确认书,确认方言的称呼应动态生成(即点工作)。

在html中,我有在页面负荷时隐藏的方言,然后在<条码>(开放式)<条码/代码>功能上显示。

这是我现在的事情,它只是一纸空谈,但一旦你证实,就重复了其他条款,没有提交表格:

var deleteConfirmed = false;
$( form.confirm-form ).submit(function(e) {
if ( ! deleteConfirmed)
{
    e.preventDefault();
    var title = $(this).find( input.action ).val();
    var $this = $(this);
    console.log( title:   + title);

    $( #confirm-dialog ).attr( title , title);

    $( #confirm-dialog ).dialog({
        buttons : {
            "Confirm" : function() {
                deleteConfirmed = true;
                $(this).dialog( close );
                $this.submit();
            },
            "Cancel" : function() {
                $(this).dialog( close );
            }
        }
    });

    $( #confirm-dialog ).dialog( open );
}
else
{
    $(this).submit();
    deleteConfirmed = false;
}
});
最佳回答

http://www.ohchr.org。

这里可以找到解决办法。 我在一家生活服务器上测试了它,因为我正在 j上一些不寻常的行为。 注:我拆除了原来的员额,因为它没有处理多种形式的问题。 提交表格的可能性很可能是与阿富汗武装部队提交的。

资料来源:x.html。


<!DOCTYPE html>
<html>
<head><title>SO</title>
<script
  type="text/javascript"
  src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
<script
  type="text/javascript"
  src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js">
</script>
<link
  rel="stylesheet"
  type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css"/>
</head>
<body>

<div id="dlg1"></div>
<form method="post" action="/so/x.php" id="frm1" name="frm1">
    <input type="text"><br />
    <input type="submit" class="submitter_btn" id="frm1_submit">
</form>
<form method="post" action="/so/x.php" id="frm2" name="frm2">
    <input type="text"><br />
    <input type="submit" class="submitter_btn" id="frm2_submit">
</form>
<form method="post" action="/so/x.php" id="frm3" name="frm3">
    <input type="text"><br />
    <input type="submit" class="submitter_btn" id="frm3_submit">
</form>


<script type="text/javascript">
var $current = { form : null, do_submit : false };

$( #dlg1 ).dialog({
    title: "Confirmation",
    width: 300,
    height: 200,
    autoOpen: false,
    modal: true,
    buttons : {
      "Confirm" : function(e){
        $current.do_submit = true;
        $(this).dialog( close );
      },
      "Cancel"  : function(e){
         $current.do_submit = false;
         $(this).dialog( close );
      }
    }
});

$( #dlg1 ).bind( dialogbeforeclose , function(){
    if($current.do_submit){
      ($current.form).submit();
      $current.form = null;
      $current.do_submit = false;
    }
});

$( .submitter_btn ).click(function(e){
    e.preventDefault();
    $current.form = $(this).parents( form:first );
    $( #dlg1 ).dialog( open );
});


</script>
</body>
</html>

资料来源:x.php。


<?php
echo "HELLO";
问题回答

我在我发现





相关问题
How to start to create an application GUI using C#?

HI! I am new to C# and plan to use it for my application GUI. I am trying to make my GUI similar to SPSS:http://www.spss.com/images/08/statistics_screens/ez_rfm-big.jpg Is this easy in C#? Is there ...

Automatic height of edit box

My shoes application has three items stacked on top of each other (with a stack, of course), in order: A banner An edit box Two buttons in a flow What I want to do is have the banner stay at it s ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

UI And TcpClient Issue in vb.net

I m having some problems with a small ircbot i m writing. Basically I connect to the server using a tcpclient in a seperate class, which also runs on its own thread. I want to display the server text ...

UI Convention: Shortcut key for application exit? [closed]

Is there a convention for the shortcut keys for application exit? Some applications uses Alt+X some others use Ctrl+ X and Ctrl+Q. Applications like FF and IE doesnot assign a shortcut at all. So is ...

热门标签