So I can use 'getDBresults.php' as the url which creates an XML output
from some SQL query? That'd be cool.
Another question, why does the demo page's source say,
"autocomplete="off"?
And, the demo page doesn't have any parameters after the url:
type="text/javascript">new Ajax.Autocompleter('contact_name',
'contact_name_auto_complete', '/ajax/auto_complete_for_contact_name',
{})
How does it know what to do?
I've copied the contents of the demo into my own page and still cannot
get it to work (pointing at a generic unordered list). My page keeps
saying "ajax.autocompleter not valid constructor" or something. All
of my js files are pointing to the correct places.
www.parkereye.com/eye
On Mar 28, 7:41 am, David Dashifen Kees <[EMAIL PROTECTED]> wrote:
> Technically, it doesn't matter what format it's in. As long as its
> output is an unordered list you're good to go. For example, you could
> use PHP to connect to a database and extract information about contact
> names and then display them like this:
>
> <ul>
> <li>Doe, Jane</li>
> <li>Kees, David</li>
> <li>Smith, John</li>
> </ul>
>
> As long as your output is formatted thusly, the AutoCompleter should do
> the rest. Therefore, you can use PHP, XML, ColdFusion, HTML, whatever,
> as long as you have an unordered list when you're done.
>
> -- Dash --
>
> apparker wrote:
> > I'm still not sure what you mean by the url... the demo page's source
> > says it is using "/ajax/auto_complete_for_contact_name". What file is
> > this pointing to? It doesn't have an extension. Do I point it at an
> > XML file? Text file? What format does it have to be in?
>
> > On Mar 28, 2:20 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
> >> apparker a écrit :
>
> >>> I'm new to js and rails. I've created a page and i'm trying to
> >>> implement the autocomplete. I do'nt know where the data comes from.
> >>> The demo says it comes from "/ajax/auto_complete_for_contact_name" -
> >>> what is that? I downloaded some of the files from scriptaculous and
> >>> they have a url which is an html file that is in the shape of XML.
> >>> Where exactly does the info come from that populates the div?
>
> >> With Autocompleter.Local, it comes from a JS array in your page.
> >> With Ajax.Autocompleter, it is provided by a URL in your app, which
> >> takes one parameter (the default name is that of your text field, but
> >> can be customized), and produces a <ul>/<li> list of results.
>
> >> It's all there, with all the necessary details:
>
> >> http://wiki.script.aculo.us/scriptaculous/show/Ajax.Autocompleter
>
> >> The wiki also provides you with basic styling for that result, so you
> >> obtain a decent aspect.
>
> >> --
> >> Christophe Porteneuve a.k.a. TDD
> >> "[They] did not know it was impossible, so they did it." --Mark Twain
> >> Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---