Solved

Autocomplete form field using PHP and MYSQL

Posted on 2007-11-19
4
7,360 Views
Last Modified: 2013-12-13
Hello Guy,

       I´m trying to use a text form field with autocomplete function (the data comes from mysql database). I tried to use the dmsautocomplete script but I cant get this script to work.

Could you help me to get this work?

Thanks,
//The form is this
//I´m using mysqli to connect to database and PHP 5
 
<form method='post' action='new_registry.php'>
 <table bgcolor='#cccccc'>
   <tr>
     <td>Nome do medicamento:</td>
     <td><input type='text' name='name' size=60 maxlength=128></td></tr>
   <tr>
     <td>Code Number :</td>
     <td valign='top'><input type='text' name='code_number'
                     size=10 maxlength=7></td></tr>
   <tr>
   <tr>
     <td>Code2 :</td>
     <td valign='top'><input type='text' name='code2'
                     size=5	maxlength=2></td></tr>
   <tr>
     <td>Quantity:</td>
     <td valign='top'><input type='text' name='quantity'
                     size=5 maxlength=6></td></tr>
   <tr>
     <td> Price :</td>
     <td><input type='text' name='price' size=5 maxlength=6></td></tr>
   <tr>
     <td colspan=2 align='center'>
     <input type='submit' value='OK'></td>
    </tr>
 </table></form>

Open in new window

0
Comment
Question by:alester
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 3

Accepted Solution

by:
seandolan earned 250 total points
ID: 20316844
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20319091
bearing in mind that if the speed is a factor (response), then autocomplete is probably not a good idea as retrieving from the server back and forth can be laggy and resource consuming.
0
 

Author Comment

by:alester
ID: 20340670
Thanks seandolan and nizsmo, i´ll see if seandolan solution works.
0
 

Expert Comment

by:lepricon
ID: 23361197
A good idea is to look at this PHP component, I use it in a number of projects and the performance is satisfactory

http://woork.blogspot.com/2008/03/php-components-autosuggest.html
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question