Re: [PHP] html form elements as php arrays

2004-05-07 Thread John Nichel
Matthew Oatham wrote:

Hi,

I am retrieving data from a database and displaying results on a html so
the user can edit them, I am sending the html form back to the server as an
array, i.e on my html for I might have 10 name fields so in the html code
all name fields are named name[] then I can iterate through the array on the
server. My problem isn't strictly php but more html / javascript. if I have
a load of form field elements all named name[] how do I access them to do
javascript validation? i.e document.form.name[].value doesn't work!
Cheers

Matt
Please wrap your lines.

document.form.elements['name[]'].value

Matthew Oatham wrote:
 Mmmm that didn't work either!

 Thanks anyway

 Matt
Please reply to the list, and not just an individual person.

Anywho, if you want to address an element whose name contains special 
characters, the above way does work.

If these are check boxes, you have to loop thru them.  If these are 
text, you will have to loop thru all the elements on the page, and 
'look' for them. etc.

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] html form elements as php arrays

2004-05-06 Thread Matthew Oatham
Hi,

I am retrieving data from a database and displaying results on a html so the user can 
edit them, I am sending the html form back to the server as an array, i.e on my html 
for I might have 10 name fields so in the html code all name fields are named name[] 
then I can iterate through the array on the server. My problem isn't strictly php but 
more html / javascript. if I have a load of form field elements all named name[] how 
do I access them to do javascript validation? i.e document.form.name[].value doesn't 
work! 

Cheers

Matt

Re: [PHP] html form elements as php arrays

2004-05-06 Thread John Nichel
Matthew Oatham wrote:
Hi,
I am retrieving data from a database and displaying results on a html so the user can edit them, I am sending the html form back to the server as an array, i.e on my html for I might have 10 name fields so in the html code all name fields are named name[] then I can iterate through the array on the server. My problem isn't strictly php but more html / javascript. if I have a load of form field elements all named name[] how do I access them to do javascript validation? i.e document.form.name[].value doesn't work! 

Cheers
Matt
Please wrap your lines.
document.form.elements['name[]'].value
--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php