SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Arrays

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2011
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Arrays

    Hi,

    I'm making a form in html and i need to have a few select menus/drop down menus, and i was wondering if rather than putting in heaps of <options> etc could i use javascript arrays to do this???

    maybe make one array for days for example and refer to it multiple times

    Any ideas? i need to make several for dates of the month , months and years.

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You could do this, but you'd be much better off doing this looping on the server-side.

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,718
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Raffles View Post
    You could do this, but you'd be much better off doing this looping on the server-side.
    That way the data data is available to everyone, not just the people who haven't disabled javascript for various reasons including:
    • personal choice
    • business demands
    • security reasons
    • bloody mindedness
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Tags for this Thread

Bookmarks

Posting Permissions

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