Problem with passing array

L

Leszek

In my form I've got some dropdown lists that are stored into an array

<select name="daneres[$idhotelu][$pomocnicza][]"
id="daneres[$idhotelu][$pomocnicza][]">
//opions
</select>

What is the way to send this array to javascript?

I need to check each row of the table searching for values >0

I try to use
var ObjFormSel1 = document.getElementById("daneres["+num1+"]["+num2"][]")

but i think it's not working because when i'm trying to do something like
this:


if( ( (ObjFormSel1[k].value)!=0) || (ObjFormSel1[k].selectedIndex!=0)){
wyb1=true;}

I'm getting error messages saying that an object is required.

What should I change to make it work?

Thanks.
Leszek
 
R

Randy Webb

Leszek said the following on 2/6/2006 8:51 AM:
In my form I've got some dropdown lists that are stored into an array

Thats not "stored in an array". It uses array-name syntax to give it a
name and ID.
<select name="daneres[$idhotelu][$pomocnicza][]"
id="daneres[$idhotelu][$pomocnicza][]">
//opions
</select>

What is the way to send this array to javascript?

It's not an array, see above.
I need to check each row of the table searching for values >0

What table? You give select code and then mention a table.
I try to use
var ObjFormSel1 = document.getElementById("daneres["+num1+"]["+num2"][]")
http://jibbering.com/faq/#FAQ4_25

elRef=document.formNameOrID.elements['daneres[$idhotelu][$pomocniza][]']

but i think it's not working because when i'm trying to do something like
this:


if( ( (ObjFormSel1[k].value)!=0) || (ObjFormSel1[k].selectedIndex!=0)){
wyb1=true;}
I'm getting error messages saying that an object is required.
What should I change to make it work?

Probably all of it.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top