passing html input value into jquery ui dialog ass variable

passing html input value into jquery ui dialog ass variable

I have a html form with an autocomplete input field that open an jquery dialog. In this dialog i have an sql search that will need the value from the input box. How can i get the input in the Dialog box ass variable?

Here is what i have:

  1. <!--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"; ?>