>All Tutorials 
Ajax and .NET Ajax and .NET RSS XML
Ajax and ColdFusion Ajax and ColdFusion RSS XML
Ajax and Java Ajax and Java RSS XML
Ajax and PHP Ajax and PHP RSS XML
Ajax and SOA Ajax and SOA RSS XML
Ajax Goodies Ajax Goodies RSS XML
Ajax Tool Ajax Tool RSS XML
Facebook MockAjax Facebook MockAjax RSS XML
Google Web Toolkit Google Web Toolkit RSS XML
JavaScript Framework JavaScript Framework RSS XML
Ruby on Rails Ruby on Rails RSS XML
Technique Introduction Technique Introduction RSS XML
Without XMLHttpRequest Without XMLHttpRequest RSS XML
Yahoo! UI Yahoo! UI RSS XML

Using Ajax Agent and PHP for Auto-Complete - function artistname php search select add list box

 
Registered tutorials: 501
Registered Users: 24390



Rating: 3.15 out of 13 votes cast


  
Category: Ajax and PHP

Using Ajax Agent and PHP for Auto-Complete

Digg this   Post to del.icio.us

Abstract: Explains how to use AjaxAgent and PHP to create an Ajax Auto-Complete box with a drill-down list of data.

Description: In this HOWTO I will explain how to use AjaxAgent and PHP to create an Ajax Auto-Complete box with a drill-down list of data. The UI is very simple. It consists of a TextBox to enter an Artists' Name, a selectbox to display the Albums and an unordered list to display the songs on an album.

  1. Auto Complete
  2. Posting Back
  3. On Your Own

Part 1: Auto Complete

Start by creating a new PHP page and placing the agent.php file in the same directory. Open your new PHP page in an editor and start hacking away.

First create the HTML Form controls we will be using:

  1. txtArtists = TextBox to type the ArtistName in.
  2. matches = A SelectBox with an onclick event which will be used to send the ArtistName to the AlbumSearch method we will be creating.
  3. txtArtistID = Hidden to hold the selected ArtistName (js cannot see the select box because it is hidden?)
  4. htmlOutput = An empty DIV when we will be creating a list of Albums
  5. htmlOutputTracks = An empty DIV when we will be creating a list of Tracks

HTML:

<form>
<input name="artistName" id="artistName" size="20" type="text" 

onkeyup="GetArtist();return false;" autocomplete="off">
<br>
<select id="matches" style="VISIBILITY: hidden" 
onclick="MatchSelected(this);" ></select>
 
<hr>
<div id="htmlOutput"></div>
<hr>

<div id="htmlOutputTracks"></div>
</form>


Read Full Tutorial...



Reviews:

Rate and Review This Site

No reviews yet


Statistic Information About this Resource:


Total Hits: 2154
Unique Hits: 1813


  Daily Weekly Monthly
  Unique Total Unique Total Unique Total
Average 2.6 2.7 18.2 21.4 62.1 72.3
Current 3 3 16 16 58 74
Previous 6 6 16 18 131 147
Jul 22 5 5 14 24 0 0
Jul 21 2 2 23 28 94 105
Jul 20 4 4 21 24 94 113
Jul 19 2 2 0 0 78 90
Jul 18 0 0 36 44 0 0
Jul 17 1 1 21 22 79 98
Jul 16 2 3 35 38 40 43
Jul 15 1 1 0 0 47 53
Highest 17 19 71 84 227 276


Script Execution Time: 7.57885 | SQL Queries: 10 | Members: 501
Ajax Tutorial Top List - Powered by Aardvark Topsites PHP 5.1.2