Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: Basic array stuff

Reply
Thread Tools

Re: Basic array stuff

 
 
richard
Guest
Posts: n/a
 
      10-05-2008
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[i].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.


 
Reply With Quote
 
 
 
 
Dr J R Stockton
Guest
Posts: n/a
 
      10-05-2008
On Oct 5, 9:17*pm, richard <mem...@newsguy.com> 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, ....|
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Basic array stuff Thomas 'PointedEars' Lahn HTML 0 10-06-2008 09:32 AM
Basic Stuff wink.co.nr C++ 4 05-17-2007 07:46 PM
Basic stuff Sparko ASP .Net 3 04-20-2005 10:36 AM
What is some basic stuff? Tom C++ 3 12-14-2003 12:46 AM
brief questions on basic stuff mat DVD Video 0 11-25-2003 10:36 PM



Advertisments