Hello everybody. I''m wondering if there is away with scriptaculous to update multiple form fields with data after finishing an autocomplete request. Heres an example. Joe BlowSchmoe fills in his name and starts to type in the customer number, he selects the approprate customer number from autocomplete list, and bam the address associated with the customer number is populated into the approrate fields. Thanks _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Yes, The easiest way is to execute another function onUpdate that populates the data, by executing another AJAX call That is, Do the autocomplete, and on update execute an ajax call to find the address data and populate the appropriate form fields. Deco On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote:> Hello everybody. > > I''m wondering if there is away with scriptaculous to update > multiple form fields with data after finishing an autocomplete > request. > Heres an example. > > Joe BlowSchmoe fills in his name and starts to type in the customer > number, he selects the approprate customer number from autocomplete > list, and bam the address associated with the customer number is > populated into the approrate fields. > > Thanks > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Being the slow nitwit that I am, would you mind doing a quick example of the last part? <input type="text" id="custnum" name="_custnum" tabindex="1" value=""> <input type="hidden" name="custnum" value="-1"> <div id="updatecustnum" class="autocomplete"></div> <script type="text/javascript" language="javascript"> new Ajax.Autocompleter(''custnum'',''updatecustnum'',''cnQuery.php'', {paramName: "q",minChars: 1, afterUpdateElement: updateHidden }); </script> Thats my autocomplete code, that works :D. Would I put the AJAX call after the afterUpdateElement? On 6/21/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote:> > Yes, > > The easiest way is to execute another function onUpdate that > populates the data, by executing another AJAX call > > That is, > > Do the autocomplete, and on update execute an ajax call to find the > address data and populate the appropriate form fields. > > Deco > On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote: > > > Hello everybody. > > > > I''m wondering if there is away with scriptaculous to update > > multiple form fields with data after finishing an autocomplete > > request. > > Heres an example. > > > > Joe BlowSchmoe fills in his name and starts to type in the customer > > number, he selects the approprate customer number from autocomplete > > list, and bam the address associated with the customer number is > > populated into the approrate fields. > > > > Thanks > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Can this be done through prototype or scriptaculous, or would i have to get another ajax js libraray and add that? On 6/21/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote:> > Yes, > > The easiest way is to execute another function onUpdate that > populates the data, by executing another AJAX call > > That is, > > Do the autocomplete, and on update execute an ajax call to find the > address data and populate the appropriate form fields. > > Deco > On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote: > > > Hello everybody. > > > > I''m wondering if there is away with scriptaculous to update > > multiple form fields with data after finishing an autocomplete > > request. > > Heres an example. > > > > Joe BlowSchmoe fills in his name and starts to type in the customer > > number, he selects the approprate customer number from autocomplete > > list, and bam the address associated with the customer number is > > populated into the approrate fields. > > > > Thanks > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Anything can be done with prototype/scriptaculous, but it may involve programming some of your own stuff on top of it. However, in this case, are you just asking whether prototype has ajax functionality? If so, then yes, it does. Look in the documentation for Ajax.Request http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxRequest (that doc is for version 1.4, but Ajax.Request hasn''t changed since then, AFAIK). Greg ________________________________ From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dallas Cahker Sent: Wednesday, June 21, 2006 1:58 PM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] scriptaculous question Can this be done through prototype or scriptaculous, or would i have to get another ajax js libraray and add that? On 6/21/06, Deco Rior < decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org <mailto:decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> > wrote: Yes, The easiest way is to execute another function onUpdate that populates the data, by executing another AJAX call That is, Do the autocomplete, and on update execute an ajax call to find the address data and populate the appropriate form fields. Deco On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote:> Hello everybody. > > I''m wondering if there is away with scriptaculous to update > multiple form fields with data after finishing an autocomplete > request. > Heres an example. > > Joe BlowSchmoe fills in his name and starts to type in the customer > number, he selects the approprate customer number from autocomplete > list, and bam the address associated with the customer number is > populated into the approrate fields. > > Thanks > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Thanks I have prototype/scriptaculous lib so I didnt want to have to do more work if prototype/scriptaculous lib had the basics of a call. On 6/21/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote:> > Anything can be done with prototype/scriptaculous, but it may involve > programming some of your own stuff on top of it. However, in this case, are > you just asking whether prototype has ajax functionality? If so, then yes, > it does. > > > > Look in the documentation for Ajax.Request > http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxRequest(that doc is for version > 1.4, but Ajax.Request hasn''t changed since then, AFAIK). > > > > Greg > > > ------------------------------ > > *From:* rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: > rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] *On Behalf Of *Dallas Cahker > *Sent:* Wednesday, June 21, 2006 1:58 PM > *To:* rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > *Subject:* Re: [Rails-spinoffs] scriptaculous question > > > > Can this be done through prototype or scriptaculous, or would i have to > get another ajax js libraray and add that? > > On 6/21/06, *Deco Rior* < decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: > > Yes, > > The easiest way is to execute another function onUpdate that > populates the data, by executing another AJAX call > > That is, > > Do the autocomplete, and on update execute an ajax call to find the > address data and populate the appropriate form fields. > > Deco > On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote: > > > Hello everybody. > > > > I''m wondering if there is away with scriptaculous to update > > multiple form fields with data after finishing an autocomplete > > request. > > Heres an example. > > > > Joe BlowSchmoe fills in his name and starts to type in the customer > > number, he selects the approprate customer number from autocomplete > > list, and bam the address associated with the customer number is > > populated into the approrate fields. > > > > Thanks > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Are you okay now, or do you need the example? Deco On Jun 21, 2006, at 2:42 PM, Dallas Cahker wrote:> Thanks I have prototype/scriptaculous lib so I didnt want to have > to do more work if prototype/scriptaculous lib had the basics of a > call. > > On 6/21/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > Anything can be done with prototype/scriptaculous, but it may > involve programming some of your own stuff on top of it. However, > in this case, are you just asking whether prototype has ajax > functionality? If so, then yes, it does. > > > Look in the documentation for Ajax.Request http:// > www.sergiopereira.com/articles/prototype.js.html#UsingAjaxRequest > (that doc is for version 1.4, but Ajax.Request hasn''t changed since > then, AFAIK). > > > Greg > > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails- > spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Dallas Cahker > Sent: Wednesday, June 21, 2006 1:58 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails-spinoffs] scriptaculous question > > > Can this be done through prototype or scriptaculous, or would i > have to get another ajax js libraray and add that? > > On 6/21/06, Deco Rior < decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: > > Yes, > > The easiest way is to execute another function onUpdate that > populates the data, by executing another AJAX call > > That is, > > Do the autocomplete, and on update execute an ajax call to find the > address data and populate the appropriate form fields. > > Deco > On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote: > > > Hello everybody. > > > > I''m wondering if there is away with scriptaculous to update > > multiple form fields with data after finishing an autocomplete > > request. > > Heres an example. > > > > Joe BlowSchmoe fills in his name and starts to type in the customer > > number, he selects the approprate customer number from autocomplete > > list, and bam the address associated with the customer number is > > populated into the approrate fields. > > > > Thanks > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
No what you said was perfect, and the stuff from the others helped with the other piece. I do have one other question, if this is a php form and I include a script with functions, how would I call the functions rather then a php page and pass params with the autocomplete? new Ajax.Autocompleter(''rep'',''updaterep'',''acQuery.php'', {paramName: "q",minChars: 1, afterUpdateElement: updateHidden }); new Ajax.Autocompleter(''rep'',''updaterep'',''<?=acQuery()?>'', {paramName: "q",minChars: 1, afterUpdateElement: updateHidden }); On 6/21/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote:> > Are you okay now, or do you need the example? > Deco > > On Jun 21, 2006, at 2:42 PM, Dallas Cahker wrote: > > Thanks I have prototype/scriptaculous lib so I didnt want to have to do > more work if prototype/scriptaculous lib had the basics of a call. > > On 6/21/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > > > Anything can be done with prototype/scriptaculous, but it may involve > > programming some of your own stuff on top of it. However, in this case, are > > you just asking whether prototype has ajax functionality? If so, then yes, > > it does. > > > > > > Look in the documentation for Ajax.Request http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxRequest > > (that doc is for version 1.4, but Ajax.Request hasn''t changed since > > then, AFAIK). > > > > > > Greg > > > > ------------------------------ > > > > *From:* rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto: > > rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] * On Behalf Of *Dallas > > Cahker > > *Sent:* Wednesday, June 21, 2006 1:58 PM > > *To:* rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > *Subject:* Re: [Rails-spinoffs] scriptaculous question > > > > > > Can this be done through prototype or scriptaculous, or would i have to > > get another ajax js libraray and add that? > > > > On 6/21/06, *Deco Rior* < decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: > > > > Yes, > > > > The easiest way is to execute another function onUpdate that > > populates the data, by executing another AJAX call > > > > That is, > > > > Do the autocomplete, and on update execute an ajax call to find the > > address data and populate the appropriate form fields. > > > > Deco > > On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote: > > > > > Hello everybody. > > > > > > I''m wondering if there is away with scriptaculous to update > > > multiple form fields with data after finishing an autocomplete > > > request. > > > Heres an example. > > > > > > Joe BlowSchmoe fills in his name and starts to type in the customer > > > number, he selects the approprate customer number from autocomplete > > > list, and bam the address associated with the customer number is > > > populated into the approrate fields. > > > > > > Thanks > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
If I have understood you correctly, using prototype (and not other frameworks) this is the solution: - You define tasks for your php file query.php?task=listItems&search=adam query.php?task=autocomplete&id=3 at the top of your php put a switch: switch( $task ) { case ''listItems'': myFuncListItems($search); break; case ''autocomplete'': myFuncAutocomplete($id); break; } this way you can call the same php for different (ajax) tasks. Hope it helps you. Danial On 6/21/06, Dallas Cahker <christmasfruitcake-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No what you said was perfect, and the stuff from the others helped with the > other piece. I do have one other question, if this is a php form and I > include a script with functions, how would I call the functions rather then > a php page and pass params with the autocomplete? > > new Ajax.Autocompleter(''rep'',''updaterep'',''acQuery.php'', {paramName: > "q",minChars: 1, afterUpdateElement: updateHidden }); > > new Ajax.Autocompleter(''rep'',''updaterep'',''<?=acQuery()?>'', > {paramName: "q",minChars: 1, afterUpdateElement: updateHidden }); > > > On 6/21/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: > > > > > > Are you okay now, or do you need the example? > > > > > > Deco > > > > > > > > On Jun 21, 2006, at 2:42 PM, Dallas Cahker wrote: > > > > Thanks I have prototype/scriptaculous lib so I didnt want to have to do > more work if prototype/scriptaculous lib had the basics of a call. > > > > > > On 6/21/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > > > > > > > > > > > > > > > > > Anything can be done with prototype/scriptaculous, but it may involve > programming some of your own stuff on top of it. However, in this case, are > you just asking whether prototype has ajax functionality? If so, then yes, > it does. > > > > > > > > > > > > Look in the documentation for Ajax.Request > http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxRequest > (that doc is for version 1.4, but Ajax.Request hasn''t changed since then, > AFAIK). > > > > > > > > > > > > Greg > > > > > > > > > > > > > > > ________________________________ > > > > > > > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org ] On > Behalf Of Dallas Cahker > > > Sent: Wednesday, June 21, 2006 1:58 PM > > > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > Subject: Re: [Rails-spinoffs] scriptaculous question > > > > > > > > > > > > > > > Can this be done through prototype or scriptaculous, or would i have to > get another ajax js libraray and add that? > > > > > > > > > On 6/21/06, Deco Rior < decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org > wrote: > > > > > > Yes, > > > > > > The easiest way is to execute another function onUpdate that > > > populates the data, by executing another AJAX call > > > > > > That is, > > > > > > Do the autocomplete, and on update execute an ajax call to find the > > > address data and populate the appropriate form fields. > > > > > > Deco > > > On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote: > > > > > > > Hello everybody. > > > > > > > > I''m wondering if there is away with scriptaculous to update > > > > multiple form fields with data after finishing an autocomplete > > > > request. > > > > Heres an example. > > > > > > > > Joe BlowSchmoe fills in his name and starts to type in the customer > > > > number, he selects the approprate customer number from autocomplete > > > > list, and bam the address associated with the customer number is > > > > populated into the approrate fields. > > > > > > > > Thanks > > > > _______________________________________________ > > > > Rails-spinoffs mailing list > > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >
Not sure you have this the right way around. I would call the php page and that calls the functions. You will need to set evalscripts to true. Deco On Jun 21, 2006, at 3:05 PM, Dallas Cahker wrote:> No what you said was perfect, and the stuff from the others helped > with the other piece. I do have one other question, if this is a > php form and I include a script with functions, how would I call > the functions rather then a php page and pass params with the > autocomplete? > > new Ajax.Autocompleter(''rep'',''updaterep'',''acQuery.php'', {paramName: > "q",minChars: 1, afterUpdateElement: updateHidden }); > > new Ajax.Autocompleter(''rep'',''updaterep'',''<?=acQuery()?>'', > {paramName: "q",minChars: 1, afterUpdateElement: updateHidden }); > > On 6/21/06, Deco Rior <decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org> wrote: > Are you okay now, or do you need the example? > > Deco > > On Jun 21, 2006, at 2:42 PM, Dallas Cahker wrote: > >> Thanks I have prototype/scriptaculous lib so I didnt want to have >> to do more work if prototype/scriptaculous lib had the basics of a >> call. >> >> On 6/21/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: >> Anything can be done with prototype/scriptaculous, but it may >> involve programming some of your own stuff on top of it. However, >> in this case, are you just asking whether prototype has ajax >> functionality? If so, then yes, it does. >> >> >> Look in the documentation for Ajax.Request http:// >> www.sergiopereira.com/articles/prototype.js.html#UsingAjaxRequest >> (that doc is for version 1.4, but Ajax.Request hasn''t changed >> since then, AFAIK). >> >> >> Greg >> >> >> From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails- >> spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org ] On Behalf Of Dallas Cahker >> Sent: Wednesday, June 21, 2006 1:58 PM >> To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> Subject: Re: [Rails-spinoffs] scriptaculous question >> >> >> Can this be done through prototype or scriptaculous, or would i >> have to get another ajax js libraray and add that? >> >> On 6/21/06, Deco Rior < decorior-w9xKMqPX1QdNhnlO7+U8Og@public.gmane.org > wrote: >> >> Yes, >> >> The easiest way is to execute another function onUpdate that >> populates the data, by executing another AJAX call >> >> That is, >> >> Do the autocomplete, and on update execute an ajax call to find the >> address data and populate the appropriate form fields. >> >> Deco >> On Jun 21, 2006, at 12:54 PM, Dallas Cahker wrote: >> >> > Hello everybody. >> > >> > I''m wondering if there is away with scriptaculous to update >> > multiple form fields with data after finishing an autocomplete >> > request. >> > Heres an example. >> > >> > Joe BlowSchmoe fills in his name and starts to type in the customer >> > number, he selects the approprate customer number from autocomplete >> > list, and bam the address associated with the customer number is >> > populated into the approrate fields. >> > >> > Thanks >> > _______________________________________________ >> > Rails-spinoffs mailing list >> > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> >> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
One thing to keep in mind, if you have the form data auto filled in when the user types in the customer number you are exposing the entire customer database.... you dont want to inadvertently be compromising your customers data. Better option would be to do the ajax call after both customer number and PASSWORD have been provided. Just my 2 bits. :-) ______________________________________________________________________ Alex Duffield . Principal . InControl Solutions . http:// www.incontrolsolutions.com On 21-Jun-06, at 11:54 AM, Dallas Cahker wrote:> Hello everybody. > > I''m wondering if there is away with scriptaculous to update > multiple form fields with data after finishing an autocomplete > request. > Heres an example. > > Joe BlowSchmoe fills in his name and starts to type in the customer > number, he selects the approprate customer number from autocomplete > list, and bam the address associated with the customer number is > populated into the approrate fields. > > Thanks > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Yes actually this form I am creating is inside a users account, he only has access to his address book, his customer numbers and so on and so forth. On 6/21/06, Alex Duffield <alex-GLL9njBnHiGqPKKiFzS5XxZCeNDtXRbv@public.gmane.org> wrote:> > One thing to keep in mind, if you have the form data auto filled in when > the user types in the customer number you are exposing the entire customer > database.... > you dont want to inadvertently be compromising your customers data. Better > option would be to do the ajax call after both customer number and PASSWORD > have been provided. > > Just my 2 bits. :-) > > ______________________________________________________________________ > > *Alex Duffield* *.* *Principal* *.* *InControl Solutions* *.* * > http://www.incontrolsolutions.com* <http://www.incontrolsolutions.com/> > > > > > On 21-Jun-06, at 11:54 AM, Dallas Cahker wrote: > > Hello everybody. > > I''m wondering if there is away with scriptaculous to update multiple form > fields with data after finishing an autocomplete request. > Heres an example. > > Joe BlowSchmoe fills in his name and starts to type in the customer > number, he selects the approprate customer number from autocomplete list, > and bam the address associated with the customer number is populated into > the approrate fields. > > Thanks > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs