Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Array and Dialog box

    Hey Scripters,

    I need to complete a task for a friend and I am stuck at this part. I am new with Javascript but I'm his only friend that knows a bit of Javascript.

    So for this problematic part of my task, I need to use tables and dialog boxes.

    First of all I need to define an array of 3 elements. Each element is associated with a different first name.

    Then I shall realize a first function to add a name in the table. The function takes as parameter the table previously created and return it containing an additional element whose value is the name that the visitor wants to add. I must use the dialog box prompt so that the user can specify the name he wishes to add in the table.

    I shall also perform a second function which will display the name that is included in the different array elements. This function will also take the table in parameters and proceed with setting the display name with a dialog box alert type that contains all of the name separated by ";".


    Help is very much appreciated.

    Please don't post links, I need explanations, so that I can understand next time I encounter this situation.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,099
    Thanks
    38
    Thanked 498 Times in 492 Posts
    Do you have an attempt at this homework assignment?

    See: http://www.webdeveloper.com/forum/fo...c&daysprune=30

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,494 Times in 4,458 Posts
    jmrker means specifically
    http://www.webdeveloper.com/forum/sh...d.php?t=240566

    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:
    http://www.codingforums.com/rules.htm

    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.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,099
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Thumbs up

    Quote Originally Posted by Old Pedant View Post
    jmrker means specifically
    ...
    *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.
    Boy, you took a lot of words to say what I meant!

  • #5
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,561
    Thanks
    80
    Thanked 4,494 Times in 4,458 Posts
    LOL!!!

    I just get so tired of these "doing this for a friend" or "I urgently need help for my website" or ...

    All the possible ways of not admitting that this is a homework assignment.

    It's like they all think we are certified idiots. Have they never looked at a real website, to see how much more complex it is than these toy assignments? Or, even when the sites aren't complex, have they ever seen one that *really* asked questions using prompt boxes and gave answers with alerts???
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •