Hi Lir,
after such a mass of response it took me some time to catch up ;o)

Ok here is what I think:
You are returning the HTML- Tags from your Script urging Ajax.Updater
to add it to your webpage, right?

Did you try to return some JSON or XML data using Ajax.Request and
create the options by Javascript ??
I think I had a similar problem like you a while ago and solved it that way ..

If you are using prototype you might find the following useful:

<-- snip -->
// var select is the DOM- object of the select- field to be modified
// var data is normaly returned from the response script. here it is
created by hand to show the structure
var data      = new Array();
    data.push({optText:'Red', optValue:'red'}, {optText:'Yellow',
optValue:'yel'},
              {optText:'Green', optValue:'gre'});
// add the new options
        data.each ( function (item){
                                var option = new Option(item.optText , 
item.optValue);
                                select.options[select.length] = option; // add 
an
option to the end of the current selection list
                            }
        );
<-- snip -->

I use this to create a set of selection field depending on each other.

hope this helps after all

lg
Bastian


On 10/8/07, Brian Williams <[EMAIL PROTECTED]> wrote:
> Very good point Lisa.  It reminded me of what I forgot to ask earlier to the
> OP..
>
> Do you use Firebug? or Fiddler or some other HTTP Proxy?
>
> If so can you verify that there is actually a value SET to each option on
> the AJAX returned text?
>
> a.k.a. verify that the returned text is not something along the lines of:
>
> <option value="">Something</option>
>
> if it is it would result in the error you are experiencing.
>
>
>
>
>
> On 10/8/07, Lisa B <[EMAIL PROTECTED]>
> wrote:
> >
> > maybe you need double quotes around that value attribute, you are echo-
> > ing single quotes around your value, is that even valid html?
> >
> > foreach ($return as $row)
> >         {
> >             echo "<option value='$row[LOSS]' selected>$row[LOSS]</
> > option></br>";
> >         }
> >
> >
> > and, is that value really being echoed?  I've had trouble with echo-
> > ing associative arrays inside double quotes. maybe something like
> > this..
> >             echo '<option value="'.$row[LOSS].'" selected>'.
> > $row[LOSS].'</
> > option></br>';
> >
> >
> > btw, is LOSS the name of the array element or a variable holding the
> > name?  php is going to take a long time to figure that out.. should
> > have single or double quotes around 'LOSS' I think...
> >
> > also what about this:
> >
> > new Ajax.Updater(
> >         {success: 'lossResult'}, url,{method: 'get', parameters:
> > params, asynchronous:true, evalScripts:true});
> >
> >
> > why brackets and the word 'success' in the first attribute?  maybe I'm
> > just not familiar with that syntax.. I would do this:
> >
> > new Ajax.Updater('lossResult', url, {method: 'get', parameters:
> > params, asynchronous:true, evalScripts:true}
> > );
> >
> >
> > > >
> >
>


-- 
--
spread the word ... see  www.browsehappy.com ;o)

Calvin: Weekends don't count unless you spend them doing something
completely pointless.

Join the Greater IBM  Connection (http://www.xing.com/premiumgroup-6291.d26b7d)

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to