cancel
Showing results for 
Search instead for 
Did you mean: 

save contant of dropdownlist in 2d array

Former Member
0 Kudos

HI Community,

Is it possible to save the contant of an dropdown in 2d array?

greets

Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Chris,

This is absolutely possible.

follow the below code...


 	for(var j = 0;j<this.length;j++){
 			this.items.nodes.item(j).value;  /// code
                        this.getSaveItem(j));  //display text
	} 

just use the above code and text as you need it..FYI this was code done on form ready layout of the dropdown, just change the absolute path accordingly.

let me know if this helps,

cheers,

sai

Former Member
0 Kudos

Thanks Sai,

I just want to save the data of one of my dropdowns and use these contant for another dropdown.

How could I do that?

I have these code below.

var newList = new Array();

var nItems = data.subform_1.subform_2.Field.resolveNodes("#items.#text[*]"); // **

var count = nItems.length;

var listCount = 0;

for (var i = 0; i < count; i++ ){

newList[listCount] = nItems.item(i).value;

listCount++;

}

But know I need not the direct path (**) to the contant of these dropdown - but the data of the interface which is binding the dropdown.

greets Chris.

Edited by: blaxus on Feb 17, 2011 4:56 PM

Former Member
0 Kudos

Hi,

The above Code I posted there I do the same as you required it.

in my process its some thing like.

The actual dropdown is a multi select with 20 entries

when user selects n entries of 20 from the dropdown I need to populate these n entries to another dropdown.

for the form to have the status as usual I also I save them to a text field. and on form ready i compare and populate them to the dropdwon again.

this should do your job, but y do you need to read it from the data source directly without binding it to a dropdown element. is there any significant requirement as such.

Bcos we can access the data source like $.record.fieldname.value; (an exact syntax can be found inthis form just seach posts in this week i remeber it) but looping it etc is a mess. it depends how is that dropdown entry filled from the source.

as a key value pair, or a node 1:n with key &value attributes.

Cheers,

Sai

Former Member
0 Kudos

Thanks Sai,

I have got 3 dropdowns. The second depands on the first on - what the user chooses. The third on the first and second dd. E.g. the user select on the first dropdown something - the second dd depands on that choose. Afterwards if the user selects the first dd again - in the exit event (1. dd) with the code above the actual data (less than the binding) of the second dd is in the array. -> the second dd has got empty fields. But I want the actual full data of the binding of the seconend.

The code above gets the data at the runtime.

Do you know a possibility to fix my problem?

greets

Chris

Former Member
0 Kudos

Hi Mate,

Sorry, I really couldn't understand what exactly was the problem with your 3 dropdown scenario.

can you explain it further.

Cheers,

Sai