By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

Problem with passing array

P: n/a

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
Share this Question
Share on Google+
1 Reply


P: n/a
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.