Thanks, but that didn't work.

My autocompleter creation looks like this (in the window.onload

new Ajax.Autocompleter('myField', 'menu', 'myServlet'',
    paramName: 'myParam',
    parameters: 'type='+1234+'&id='+myId

The value of myId when the autocompleter is created is what's passed
to the servlet, even if I later change that value.  Likewise if I make
the parameter a function call, e.g.:

parameters: 'type='+1234+'&id='+getMyId()

then id is set to whatever getMyId() returns at the time the onload
function is called.

What I want to do is set id to be equal to the value returned from
another Autocompleter on the page (which enables this Autocompleter in
its afterUpdateElement callback), but it appears the parameters are
set when the Autocompleter is created.  It seems like what I want to
do (a succession of Autocompleters allowing a user to drill down
through a hierarchy) should be possible but I'm stuck.



On Sep 14, 5:44 am, "Alex McAuley" <>
> parameters : {
>     id : myid}
> Alex Mcauley
> ----- Original Message -----
> From: "Paul G" <>
> To: "Prototype &" <>
> Sent: Friday, September 11, 2009 11:18 PM
> Subject: [Proto-Scripty] How do I pass other parameters to Autocompleter?
> > Hi,
> >  I'm new to all this, both Ajax and Scriptaculous, so please bear
> > with my easy question.
> >  The book "Prototype and Scriptaculous in Action" gives an example of
> > extra query parameters in an Autocompleter as "one=1&two=2&three=3".
> > I'd like to pass an extra parameter that's not hard-coded but is a
> > variable that is set previously.
> >  Specifically, I've got two Autocompleter fields.  When the user
> > makes a selection in field 1 I capture an id corresponding to the
> > selection.  That works fine.  I'd like to pass that id as a query
> > parameter in the second field.
> >  This does not work:
> > {
> >  parameters: 'id='+myid
> > }
> > How can I pass the id as a query parameter in the 2nd Autocompleter?
> > Thanks,
> > Paul- Hide quoted text -
> - Show quoted text -
You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to