After sorting through the array, just loop through it and see if the
next value equals the current value.

Writing one FOR loop isn't going to kill you :)

On Jun 30, 8:59 am, few1938 <[EMAIL PROTECTED]> wrote:
> I am trying to detect whenever an array has a duplicate value and then
> produce an alert to the user that a dupe exists with the value of the
> dupe.
>
> Reading 'Prototype & Scriptaculous IN ACTION', I have been able to
> begin the coding to obtain the textarea values and sort the resultant
> array.  I am having trouble coding the duplicate value detection.
>
> Here is my limited code:
> var txtarea = $F('txtarea4').split(/[\n\r]+/);
> var atxtarea = $A(txtarea).sort();
>
> I think I should use the .detect or .any methods.
>
> Frank
--~--~---------~--~----~------------~-------~--~----~
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