我有一個獲取參數的鏈接。當我點擊它時,ajax被調用。現在,當它去使用ajax調用彈出式jquery對話框形式
action.php,我有一個PHP值(從MySQL)的形式。我想彈出與jquery
對話框。
我不知道如何做到這一點。
<script>
$(document).ready(function(){
$.ajax({
type: "GET",
url: this.href,
cache:false,
success: function(response){
if (response.length > 0) {
document.getElementById('display').innerHTML=wrapperelement;
wrapperelement.innerHTML = response;
$("#dialog-form").dialog("open");
}
}
});
});
</script>
更新代碼
該文件的正文
<body>
<div id="display"></div>
echo '<a href="action.php?pldid=' . $pldid . '" class="editbt">Edit</a>';
</body>
所以我action.php的
if (isset($_GET['pldid'])&& $_GET['pldid'])
{
$form = <<<EOF
<form>
<div id="dialog-form" title="Edit Fields">
<p class="validateTips">All form fields are required.</p>
<form>
<fieldset>
<label for="box">Box</label>
<input type='text' name='box' id='box' class="text ui-widget-content ui-corner-all" />
<label for="itemname">itemname</label>
<input type='text' name='itemname' id='itemname' class="text ui-widget-content ui-corner-all" />
<label for="size">size</label>
<input type='text' name='size' id='size' class="text ui-widget-content ui-corner-all" />
<label for="potency">potency</label>
<input type='text' name='potency' id='potency' class="text ui-widget-content ui-corner-all" />
<label for="quantity">Quantity</label>
<input type='text' name='quantity' id='quantity' class="text ui-widget-content ui-corner-all" />
</fieldset>
</form>
</div>
EOF;
echo $form;
}
我想要的鏈接,打開了形式的窗口(來自mysql的值)。任何建議是非常歡迎..謝謝你..謝謝你..
感謝您的回覆..但形式是在行動的PHP文件..對不起,我沒有提到它早... – user2234992 2013-05-13 07:33:00
實際上,我想彈出窗口與窗體的PHP值..任何想法..謝謝.. – user2234992 2013-05-13 07:33:56
謝謝你的編輯..但對話框形式的div ID是在行動PHP文件..會彈出?謝謝 – user2234992 2013-05-13 07:39:36