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:
<html>
<head>
<script src="includes/prototype.js" type="text/javascript"></
script>
<script src="includes/scriptaculous.js" type="text/javascript"></
script>
<script src="includes/modalbox.js" type="text/javascript"></script>
<link rel="stylesheet" href="includes/modalbox.css" type="text/css"
media="screen" />
</head>
<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>
<div id='modbox' style='display:none'>
<input name="input_box" id="input_box" autocomplete="off" size="40"
maxlength="2048" title="Search"><font size="-1">
<div id="input_box_update" class="autocomplete"
style="display:none;"></div>
<script type="text/javascript" language="javascript" charset="utf-8">
this.suggestionVals = new Array(
'Ryan<div class="desc"><span class="informal">Ryan</span></div>',
'Bryan<div class="desc"><span class="informal">Bryan</span></
div>',
'Robert<div class="desc"><span class="informal">Robert</span></
div>',
'Tom<div class="desc"><span class="informal">Tom</span></div>',
'Tim<div class="desc"><span class="informal">Tim</span></div>',
'Thomas<div class="desc"><span class="informal">Thomas</span></
div>');
new Autocompleter.Local('input_box','input_box_update',
this.suggestionVals, { tokens: new Array(' ','!','|','('), fullSearch:
false, partialSearch: false, choices: 20 });
</script>
</div>
</html>
On Jul 24, 1:52 am, "Justinas Urbanavicius" <
justin...@gmail.com>
wrote:
> 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);
>