我有一个带有自动完成输入字段的 html 表单,可以打开一个 jquery 对话框。在这个对话框中,我有一个 sql 搜索,需要输入框中的值。如何在对话框中获取 ass 变量的输入?
<!--autocomplete script -->
<script>
$(function() {
$( "#searchImage" ).autocomplete({
source: "search.php",
minLength: 1
});
});
</script>
<!-- Dialog Script -->
<script> $(function(){
$('#imageDialog').dialog({
autoOpen: false,
bgiframe: true,
height: "auto",
width: 900,
modal: true,
position: [ "center" , 150],
show: {
effect: "clip",
duration: 1000
},
hide: {
effect: "clip",
duration: 1000
},
buttons: {
OK: function() {
$(this).dialog( "close" );
}
}
});
$('form#imageForm').submit(function(e){
e.preventDefault();
$('#imageDialog').dialog('open');
});
});
</script>
<!-- Search Box -->
<div class="partSearch">
<form id="imageForm" name="imageForm" method="get">
<label for="image"><b>Image: </b></label>
<input id="searchImage" name="searchImage" type="text" value="" />
<input type="submit" value="Search" />
</form>
<!-- Dialog Content -->
<div id="imageDialog" title="Image">
<?php
<Code to get the Image name from input>;
//DB query
$query="select image, ssid, to_char(savetime,'DD-MM-YYYY HH24:MI') savetime, path
from table
where image like upper('%$IMAGE%')
order by image asc, savetime desc";
?>