468,242 Members | 1,587 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

Problem with passing array


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
Feb 6 '06 #1
1 1006
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Charles | last post: by
6 posts views Thread by Edd Dawson | last post: by
5 posts views Thread by sugaray | last post: by
8 posts views Thread by intrepid_dw | last post: by
11 posts views Thread by John Pass | last post: by
39 posts views Thread by Martin Jørgensen | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.