>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: 33213



Rating: 3.29 out of 14 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: 2658
Unique Hits: 2248


  Daily Weekly Monthly
  Unique Total Unique Total Unique Total
Average 3.8 4.2 17.6 20.5 81.2 94.3
Current 4 4 11 11 11 11
Previous 7 7 27 31 122 144
Nov 30 2 2 32 42 103 118
Nov 29 1 1 0 0 115 134
Nov 28 3 3 24 28 74 86
Nov 27 6 6 0 0 68 85
Nov 26 4 5 33 36 131 147
Nov 25 7 9 0 0 0 0
Nov 24 0 0 23 27 94 105
Nov 23 4 5 26 30 94 113
Highest 17 19 71 84 227 276


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