Hello, I dont know jquery. I am trying edit some code from web for autocomplete. Is it possible retrieve value afer submit from php page? What's way ? Or only with js ? Connection is ok, selecting too. Link to other page is created with paramaters. Thanks.

-- test.php --
require_once "config.php";

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<title>jQuery Autocomplete Plugin</title>
<script type="text/javascript" src="jquery.js"></script>
<script type='text/javascript' src='jquery.autocomplete.js'></script>
<link rel="stylesheet" type="text/css" href="jquery.autocomplete.css" />

<script type="text/javascript">

    $().ready(function() {

        $("#course").autocomplete("get_course_list.php", {
                width: 260,
                matchContains: true,
                //mustMatch: true,
                //minChars: 0,
                //multiple: true,
                //highlight: false,
                //multipleSeparator: ",",
                selectFirst: false
<h2 id="banner">Ajax Autocomplete Demo 
- Jquery, PHP, Mysql</h1>
<div id="content">
        <form autocomplete="off">
                        Course Name <label>:</label>
                        <input type="text" name="course" id="course" />
                        <!--input type="button" value="Get Value" /-->
                <input type="submit" value="Submit" />
<div align="center">
<a href="http://beski.wordpress.com">http://beski.wordpress.com</a>

-- get_course_list.php --

require_once "config.php";
$q = strtolower($_GET["q"]);
if (!$q) return;

$sql = "select DISTINCT course_name as course_name from course where course_name LIKE '%$q%'";
$rsd = mysql_query($sql);
while($rs = mysql_fetch_array($rsd)) {
        $cname = $rs['course_name'];
        echo "$cname\n";
Member Avatar

Is it possible retrieve value afer submit from php page

Yes. But in your example I don't see ajax jquery code.

Read more here:


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.