I'm trying to get autocomplete values from a scritpaculous
autocompleter to work inside a modalbox. Wondering if anyone has
gotten this to work before. I have written a sample script to
illustrate and pasted it below. It shows a simple autocomplete.Local
instance both on a page and then in a modalbox. It works when
displayed on the page but does not work when opened in a modalbox. You
need to link to your scriptaculous.js prototype.js and modalbox.js in
your filesystem to run this of course. Any suggestions?
<body>
Type letters 'R' or 'T' to get autocomplete suggestions<br>
<a href='#' onClick="Modalbox.show($('modbox'), {title: 'Modal
Box'});">Display in Modalbox</a><br>
<a href='#' onClick="Effect.toggle('modbox','appear')">Display on
Page</a>
On Thu, Jul 24, 2008 at 2:03 AM, Ryan <ryan.roz...@gmail.com> wrote:
> I'm trying to get autocomplete values from a scritpaculous > autocompleter to work inside a modalbox. Wondering if anyone has > gotten this to work before. I have written a sample script to > illustrate and pasted it below. It shows a simple autocomplete.Local > instance both on a page and then in a modalbox. It works when > displayed on the page but does not work when opened in a modalbox. You > need to link to your scriptaculous.js prototype.js and modalbox.js in > your filesystem to run this of course. Any suggestions?
> <body> > Type letters 'R' or 'T' to get autocomplete suggestions<br> > <a href='#' onClick="Modalbox.show($('modbox'), {title: 'Modal > Box'});">Display in Modalbox</a><br> > <a href='#' onClick="Effect.toggle('modbox','appear')">Display on > Page</a>
Thanks for the suggestion, but unfortunately it still does not work
when switching to use this object.. See the code below it is modified
to use the 'this' object. If you test it in a browser, the div that is
on the page works fine (autocomplete works) but when displayed in the
modalbox it does not:
<body>
Type letters 'R' or 'T' to get autocomplete suggestions<br>
<a href='#' onClick="Modalbox.show($('modbox'), {title: 'Modal
Box'});">Display in Modalbox</a><br>
<a href='#' onClick="Effect.toggle('modbox','appear')">Display on
Page</a>
> as written in the wiki, the var globals are discarted right after parsing
> the javascript.
> try using this object instead.
> eg.:
> this.my_var = new Array();
> then to ghet array alert(this.my_var);
> On Thu, Jul 24, 2008 at 2:03 AM, Ryan <ryan.roz...@gmail.com> wrote:
> > I'm trying to get autocomplete values from a scritpaculous
> > autocompleter to work inside a modalbox. Wondering if anyone has
> > gotten this to work before. I have written a sample script to
> > illustrate and pasted it below. It shows a simple autocomplete.Local
> > instance both on a page and then in a modalbox. It works when
> > displayed on the page but does not work when opened in a modalbox. You
> > need to link to your scriptaculous.js prototype.js and modalbox.js in
> > your filesystem to run this of course. Any suggestions?
Just one last attempt to see if anyone has gotten modalboxes to work
with scriptaculous autocompleters. As you can see in my last post, I
tried the suggestion to use the 'this' object. As modalboxes are a
great way to display form-based data and autocompleters are common in
forms, I figured someone must have tried this. Anyway I am stumped as
to how to get this to work, code snippets demonstrating this issue are
included in my previous post.
Ryan
On Jul 30, 4:11 pm, Ryan <ryan.roz...@gmail.com> wrote:
> Thanks for the suggestion, but unfortunately it still does not work
> when switching to use this object.. See the code below it is modified
> to use the 'this' object. If you test it in a browser, the div that is
> on the page works fine (autocompleteworks) but when displayed in the
> modalbox it does not:
> > as written in the wiki, the var globals are discarted right after parsing
> > the javascript.
> > try using this object instead.
> > eg.:
> > this.my_var = new Array();
> > then to ghet array alert(this.my_var);
> > On Thu, Jul 24, 2008 at 2:03 AM, Ryan <ryan.roz...@gmail.com> wrote:
> > > I'm trying to getautocompletevalues from a scritpaculous
> > > autocompleter to work inside a modalbox. Wondering if anyone has
> > > gotten this to work before. I have written a sample script to
> > > illustrate and pasted it below. It shows a simpleautocomplete.Local
> > > instance both on a page and then in a modalbox. It works when
> > > displayed on the page but does not work when opened in a modalbox. You
> > > need to link to your scriptaculous.js prototype.js and modalbox.js in
> > > your filesystem to run this of course. Any suggestions?
> Just one last attempt to see if anyone has gotten modalboxes to work
> with scriptaculous autocompleters. As you can see in my last post, I
> tried the suggestion to use the 'this' object. As modalboxes are a
> great way to display form-based data and autocompleters are common in
> forms, I figured someone must have tried this. Anyway I am stumped as
> to how to get this to work, code snippets demonstrating this issue are
> included in my previous post.
> Ryan
> On Jul 30, 4:11 pm, Ryan <ryan.roz...@gmail.com> wrote:
> > Thanks for the suggestion, but unfortunately it still does not work
> > when switching to use this object.. See the code below it is modified
> > to use the 'this' object. If you test it in a browser, the div that is
> > on the page works fine (autocompleteworks) but when displayed in the
> > modalbox it does not:
> > > as written in the wiki, the var globals are discarted right after parsing
> > > the javascript.
> > > try using this object instead.
> > > eg.:
> > > this.my_var = new Array();
> > > then to ghet array alert(this.my_var);
> > > On Thu, Jul 24, 2008 at 2:03 AM, Ryan <ryan.roz...@gmail.com> wrote:
> > > > I'm trying to getautocompletevalues from a scritpaculous
> > > > autocompleter to work inside a modalbox. Wondering if anyone has
> > > > gotten this to work before. I have written a sample script to
> > > > illustrate and pasted it below. It shows a simpleautocomplete.Local
> > > > instance both on a page and then in a modalbox. It works when
> > > > displayed on the page but does not work when opened in a modalbox. You
> > > > need to link to your scriptaculous.js prototype.js and modalbox.js in
> > > > your filesystem to run this of course. Any suggestions?
I was having this same problem and I managed to solve it by creating
the Autocompleter after calling Modalbox.show() by using Modalbox's
'afterLoad' option. In my case, z-index was not at fault. The code
might look something like:
Modalbox.show( $('autocompleteContainerDiv'),
{ afterLoad: function () {
new Autocompleter.Local('inputField',
'autocompleteResultsList',
valuesList
);
}
}
);
/*
autocompleteContainerDiv contains everything I want to show in the
Modalbox, including the input field the user types into as well as the
results list that shows up with the results from the Autocompleter
*/
Hope this helps. I was struggling with this for a while myself.
-Mani
On Aug 25, 12:50 pm, Ryan <ryan.roz...@gmail.com> wrote:
> Just one last attempt to see if anyone has gotten modalboxes to work
> with scriptaculous autocompleters. As you can see in my last post, I
> tried the suggestion to use the 'this' object. As modalboxes are a
> great way to display form-based data and autocompleters are common in
> forms, I figured someone must have tried this. Anyway I am stumped as
> to how to get this to work, code snippets demonstrating this issue are
> included in my previous post.
> Ryan
> On Jul 30, 4:11 pm, Ryan <ryan.roz...@gmail.com> wrote:
> > Thanks for the suggestion, but unfortunately it still does not work
> > when switching to use this object.. See the code below it is modified
> > to use the 'this' object. If you test it in a browser, the div that is
> > on the page works fine (autocompleteworks) but when displayed in the
> > modalbox it does not:
> > > as written in the wiki, the var globals are discarted right after parsing
> > > the javascript.
> > > try using this object instead.
> > > eg.:
> > > this.my_var = new Array();
> > > then to ghet array alert(this.my_var);
> > > On Thu, Jul 24, 2008 at 2:03 AM, Ryan <ryan.roz...@gmail.com> wrote:
> > > > I'm trying to getautocompletevalues from a scritpaculous
> > > > autocompleter to work inside a modalbox. Wondering if anyone has
> > > > gotten this to work before. I have written a sample script to
> > > > illustrate and pasted it below. It shows a simpleautocomplete.Local
> > > > instance both on a page and then in a modalbox. It works when
> > > > displayed on the page but does not work when opened in a modalbox. You
> > > > need to link to your scriptaculous.js prototype.js and modalbox.js in
> > > > your filesystem to run this of course. Any suggestions?