Get complex data from select to JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • celia05es
    New Member
    • Feb 2007
    • 1

    Get complex data from select to JavaScript

    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=getSe lect(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!
  • junal
    New Member
    • Jan 2007
    • 22

    #2
    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)...hop e it will help you.

    Comment

    Working...