Jquery $post <select>

Discussion in 'jQuery' started by samsung88, Oct 26, 2009.

  1. #1
    Hello i would like to $post a drop down list value. right now i have a auto complete that sends a suggestion back and forth . this is on index.htm


    
    <script type="text/javascript" src="jquery-1.3.2.js"></script>
    <script type="text/javascript">
    	function lookup(inputString) {
    		if(inputString.length == 0) {
    			// Hide the suggestion box.
    			$('#suggestions').hide();
    		} else {
    			$.post("rpc.php", {queryString: ""+inputString+""}, function(data){
    				if(data.length >0) {
    					$('#suggestions').show();
    					$('#autoSuggestionsList').html(data);
    				}
    			});
    		}
    	} // lookup
    	
    	
    	function fill(thisValue) {
    		$('#inputString').val(thisValue);
    		setTimeout("$('#suggestions').hide();", 200);
    	}
    
    Code (markup):
    as you can see in the $ i am sending to rpc.php
    
    if(isset($_POST['queryString'])) {
    			$queryString = $db->real_escape_string($_POST['queryString']);
    
    			if(strlen($queryString) >0) {
    							
    	 $query = $db->query("SELECT s_last, s_city FROM table_student WHERE s_last LIKE '$queryString%' or s_city LIKE '$queryString%'");
    
    Code (markup):
    i would like to replace the value in the $query (s_last, s_city) to a value coming from a drop down box. can anyone give me a hand of this plz.
     
    samsung88, Oct 26, 2009 IP