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

Get complex data from select to JavaScript

P: 1
Hello,
I have a problem that I don't have a clue how to solve. I do hope you can help me. It is a bit complicated to explain but I 'll try.

Ok, I have a select list. Once, the user clicks on one item, some other fields appears and the contents is related to the item.
The problem is that the data related to the item is complex: Each item has:
id1 (int) - descr (String) - option (boolean) - services (array)

My problem lies with the field contents!!! Once the user clicks on one item, the "onChange=getSelect(this)" is executed.
I cannot pass the data related to the item as parameters... so how can I do it?
Basically, I need to get the data knowing the name... but from JavaScript!!!
Is there an easy way of doing it?

Simple example... but not that simple to me!!
Suppose the select list is made of:
- A (10 - DescrA - false - [s1, s2,s3,s4]
- B (20 - DescrB - true - [s5,s6]
The select list only show A and B ( I don't know how to pass an array into a select). If the user clicks on "A", the fields should contain "10", DescrA, etc.

Please help!
Feb 13 '07 #1
Share this Question
Share on Google+
1 Reply

P: 22
i guess you can create separate function for each element and then you can call them according to the selection. let say u can call one function by onclick but under that function you can call others fucntion. try to use if...else combination. (i.e if you select this item then follow that function)...hope it will help you.
Feb 13 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.