Re: Basic array stuff

Discussion in 'HTML' started by richard, Oct 5, 2008.

  1. richard

    richard Guest

    On Sun, 05 Oct 2008 15:38:49 -0400, sheldonlg <sheldonlg> wrote:

    >This is kind of basic, and I googled but didn't find much help.
    >
    >I have an array of text element fields. They all need to have the same
    >name. So, let the name be either all with a[] or build individually as
    >a[0], a[1], a[2], etc. The brackets need to be there because I will
    >obtaining the values of them as an array using $_POST{'a'] in php.
    >
    >What I want to do is in javascript set the value of an individual
    >element, say a[3]. I have tried many combinations of
    >
    >1 - setting the ids all as
    > a) a
    > b) a[]
    > c) individually as a[0], a[1], etc.
    >2 - using document.getElementById
    >3 - using document.getElementsByName
    >
    >Any time I create and object from the name, and then try to use that
    >object, I get "object has no properties" in Firebug. This is true
    >whether I try obj.value or obj.value.
    >
    >So, please,
    >1 - How do I set the id attribute?
    >2 - How do I access or set an individual member in the array?
    >3 - For the name attribute, should I use a[] or individually build them
    >or does it not matter as far as javascript is concerned?
    >
    >Yes, this is basic, but I have been going in circles for a few hours now
    >so any help will be appreciated.


    Pleast post question to comp.lang.javascript.
    This group is about basic html.
     
    richard, Oct 5, 2008
    #1
    1. Advertising

  2. On Oct 5, 9:17 pm, richard <> wrote:
    > On Sun, 05 Oct 2008 15:38:49 -0400, sheldonlg <sheldonlg> wrote:
    >>


    > Pleast post question to comp.lang.javascript.
    > This group is about basic html.- Hide quoted text -



    For one of the two values of this, it is. Check where you are
    writing.

    --
    (c) John Stockton, near London, UK. Posting with Google.
    Mail: J.R.""""""""@physics.org or (better) via Home Page at
    Web: <URL:http://www.merlyn.demon.co.uk/>
    FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ....|
     
    Dr J R Stockton, Oct 5, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sparko

    Basic stuff

    Sparko, Apr 19, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    655
    Hans Kesting
    Apr 20, 2005
  2. Tom
    Replies:
    3
    Views:
    299
    Rolf Magnus
    Dec 14, 2003
  3. wink.co.nr

    Basic Stuff

    wink.co.nr, May 16, 2007, in forum: C++
    Replies:
    4
    Views:
    305
  4. Donn Ingle

    basic if stuff- testing ranges

    Donn Ingle, Nov 25, 2007, in forum: Python
    Replies:
    12
    Views:
    425
    John Machin
    Nov 26, 2007
  5. Thomas 'PointedEars' Lahn

    Re: Basic array stuff

    Thomas 'PointedEars' Lahn, Oct 6, 2008, in forum: HTML
    Replies:
    0
    Views:
    376
    Thomas 'PointedEars' Lahn
    Oct 6, 2008
Loading...

Share This Page