PHP Classes

Autocomplete box

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  Autocomplete box  >  (Un) Subscribe thread alerts  
Subject:Autocomplete box
Summary:In some cases it is not aligned properly. Here's the solution..
Messages:2
Author:ffff
Date:2007-07-18 22:18:59
Update:2007-07-22 01:43:17
 

  1. Autocomplete box   Reply   Report abuse  
Picture of ffff ffff - 2007-07-18 22:18:59
I tried to use the auto-complete plug-in with a different layout as the one in the built in example. For some reason the box that makes the suggestions while you type was not showing below the input field, but completely in other part of the page. This happened just in firefox and camino browsers.

After many hours of debugging I tried substituting the "getBoxObjectFor" javascript function that the plug-in utilizes to get the coordinates of the input field, for the function "getBoundingClientRect"

This worked perfectly and now it works in IE and in Firefox and camino too.

The changes look like this:

>>>>>>>
'if(document.getBoundingClientRect)'.$b.
'{'.$b.
'b=document.getBoundingClientRect(t);'.$b.
>>>>>>>
(in: form_auto_complete.php)

  2. Re: Autocomplete box   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-07-22 01:43:17 - In reply to message 1 from ffff
Right now, I do not have time to check this. I will be back to this in a few weeks.