所以我有一个按下按钮时弹出的表单。我想制作第二种形式,所以即时制作一个新按钮。我在我的网站上有按钮,并从第一个按钮复制了这个对话框代码,但它似乎不起作用(弹出)。谁能告诉我为什么?我唯一改变的是“dialog-new-static”,我假设它是名称,以及URL“system / aps2.newrequeststatic.php”,我假设它是按下按钮时拉动的内容。
<script type="text/javascript">
$("#newrqbtn2").button({
icons: {primary:'ui-icon-circle-plus', secondary:''}
}).click(function(e) {
$("#dialog-new-static").dialog("open");
});
</script>
<div id="tabs-10">
<button type="button" id="newrqbtn2" style="margin-bottom: 10px;">
New Static Request
</button>
<table id="statictable" style="width: 100%; clear: both;">
<thead>
<tr style="border-bottom: 1px solid black;">
<th style="font-weight: normal;">RID</th>
<th style="font-weight: normal;">Photographs Needed</th>
<th style="font-weight: normal;">Creator</th>
<th style="font-weight: normal;">User ID</th>
<th style="font-weight: normal;">Actions</th>
</tr>
</thead>
<tbody/>
</table>
</div>
<script type="text/javascript">
$("#dialog-new-static").dialog({
resizable: false,
width: 'auto',
modal: true,
fluid: true,
autoOpen: false,
buttons: {
"Clear Form": function() {
clearForm($("#newapsform"));
},
"Create Request": function() {
if(formIsOkay($("#newapsform"))) {
$.ajax({
type: "POST",
url: "system/aps2.newrequeststatic.php",
data: $("#newapsform").serialize(),
success: function() {
$("#dialog-new-static").dialog("close");
$("#goodmsg").html("Created photo request successfully!");
$('#goodmsgdiv').fadeIn(1500).delay(3000).fadeOut(1500);
datatables.fnDraw();
searchtables.fnDraw();
phototables.fnDraw();
clearForm($("#newapsform"));
},
error: function() {
$( "#dialog-new-static" ).dialog( "close" );
$("#badmsg").html("Could not create request: Use the force next time.");
$('#badmsgdiv').fadeIn(1500).delay(3000).fadeOut(1500);
}
});
}
}
}
});
</script>