jmrker means specifically
It's considered bad netiquette to crosspost the same question in different forums. Somebody will spend a bunch of time answering you only to find out that the question was already answered in the other forum. At a minimum, you should mention where else you have posted the question.
But anyway, look here:
And look at rule 1.5, especially.
You will, I am sure, pardon us if we are more than skeptical about your claim that this is "a task for a friend." Unless you mean your friend is the person who has this homework assignment.
Why do we KNOW this is homework? Quite simply because it has no possible use in the real world. I could see something like this being used as a way to add "friends" to a list of existing friends. But since the list will not be visible on any computer except the one where the name was added, it clearly has no practical purpose. Couple that with the requirement that you must use a "dialog box prompt" and then display the result via an "alert type that contains all of the name" and we know it's not something you would use on a real website. It's a beginning level homework assignment.
*IF* you do some of the work and show us what you have done and tell us what parts work and what parts don't, *THEN* you could well get some help. But we won't do the entire homework for you.