Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

javascript join fails.

I have this javascript read:
 
$(xml).find('formdata').each(function () {
                                var fieldlist = new Array();
                                $("#Title").val($(this).find('title').text());
                                $("#Text").val($(this).find('text').text());
                                $("#Text").cleditor()[0].updateFrame();
                                $(this).find('fields').each(function () {
                                    fieldlist.push($(this).find('field').text());
                                });
                                alert(fieldlist.join(', '));
                                $("#Fields").val(fieldlist.join());
                                $("#update").show();


                            });

Open in new window


Fieldlist.join(', ');
is supposed to give me item, item, item, ...
but it's giving me itemitemitem..
What am I doing wrong?

Thanks
Avatar of leakim971
leakim971
Flag of Guadeloupe image

>is supposed to give me item, item, item, ...
>but it's giving me itemitemitem..

your alert look fine, but not line 10, should be :
$("#Fields").val(fieldlist.join(", "));

instead :
$("#Fields").val(fieldlist.join());
Avatar of Evan Cutler

ASKER

still does it...any ideas?
alert does it too
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You are awesome.
That did it...
always the small things...

Thanks
>always the small things...

oh yes ;-)