0

これが私のコードです。[試してみる]ボタンを設定して、ダイアログボックスを再度開きますが、機能しません! ページをロードする際に閉じたい、Try it を押した後、このダイアログ ボックスを開きたい、PLZ HELP ME <3

 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script src="js/jquery-1.9.1.js"></script>
  <script src="js/jquery-ui.js"></script>

  <script>
  $(function() {
    $( "#dialog" ).dialog();
  });
  </script>
</head>
<body>
<button onclick="dialog">Try it</button>
<div id="dialog" title="Regjistro Window te ri">
<?php 
 // if there are any errors, display them
 if ($error != '')
 {
 echo '<div style="padding:4px; border:1px solid red; color:red;">'.$error.'</div>';
 }
 ?>
<center><span style="color: gray">Mbaj mend te dhenat!</span></center><br>
<form action="" method="post">
<center>
<table>
<tr>
<td>Emri:</td> <td><input type="text" size="15" name="uname" value="<?php echo $uname; ?>"/></td>
</tr>
<tr>
<td>Password:</td> <td><input type="text" size="15" name="password" value="<?php echo $password; ?>"/></td>
</tr>
<tr>
<td></td><td><input type="submit" name="submit" value=" Kalo "></td>
</tr>
</table>
<center>
 </form>
</div>
4

1 に答える 1

0

これを試してください:

ボタンのコードを次のように変更します。

<button id="theButton">Try it</button>

スクリプトを次のようにします。

<script>
    $(function() {
        var theDialog=$( "#dialog" ).dialog({autoOpen:false});

        $("#theButton").click(function(evt){
             theDialog.dialog('open');
        });
    });
</script>
于 2013-08-25T18:15:43.450 に答える