Need to return multiple values from script include.

Swati44
Kilo Expert

Hi All,

I need to return multiple values from a script include to onChange client script. I have tried to return object and an array but no luck. Please suggest how to achieve this.

Thanks,

Swathi

6 REPLIES 6

BeBold
Kilo Expert

Hello Swati,

 

Can you provide the code you tried..so we can find where it goes wrong

Community Alums
Not applicable

Hi Swati,

 

You can use array to return multiple values from Script include. You can use following function to populate array.

ArrayName.push('Value');

 

In the client script you can use the split function in array to check all values or you can use indexing.

 

var res = str.split("o");

OR

for(var i = 0; i < ArrayName.length; i ++) { 
    var name = ArrayName[i].getAttribute("name");

  alert(name); }

Let me know in case of any issues.