0

第一个对话效果很好。这是我正在使用的方法:

HTML <div>

<div id="newarticle-form" title="Cr&eacute;ation nouvel article">
    <form id="newarticleform" method="post" action="articles/ajout">
    <fieldset>
        <label for="validite" class="label-class">Date de validit&eacute;</label>
        <input type="text" name="validite" id="validite" size="10" maxlength="10" class="text input-class" />
        <label for="libelle" class="label-class">Libell&eacute;</label>
        <input type="text" name="libelle" id="libelle" size="50" maxlength="100" class="text input-class" />
        <label for="email" class="label-class">Description</label>
        <input type="text" name="description" id="description" value="" size="50" maxlength="250" class="text input-class" />
        <label for="pu" class="label-class">Prix unitaire</label>
        <input type="text" name="pu" id="pu" value="" size="10" maxlength="10" class="text input-class" />
    </fieldset>
    </form>
        <p class="validateTips"></p>
</div>

Javascript jquery ui 对话框:

$(function() {  
    $( "#newarticle-form" ).dialog({
        autoOpen: false,
        height: 'auto',
        width: 700,
        modal: true,
        resizable:false,
        buttons: {
                "Ajouter article": function() {
                        .... here is the preparation of the submit ....

            $("#newarticleform").submit();
                 $(this).dialog("close");
            },

               "Fermer": function() {
                   $(this).dialog( "close" );
               }
            }
    });

 $("#New") //The button to open the dialog
    .click(function() {
        $("#newarticle-form").dialog("open");

    });
});

它运作良好!

此页面有第二个 jquery ui 对话框。当我使用相同的方法(但不是相同的 id)添加它时,此对话框会在大约一秒钟后打开并关闭。

为什么 ?

4

0 回答 0