Solved

Autocomplete form field using PHP and MYSQL

Posted on 2007-11-19
4
7,355 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
simplest php form 3 61
Whether to use true/false, yes/no or 0/1 11 51
Update from TABLE-A to TABLE-B 5 39
PHP: concatenate query 13 39
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 …

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now