Need to return multiple values from script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2018 12:00 AM
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
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2018 03:26 AM
Hello Swati,
Can you provide the code you tried..so we can find where it goes wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2018 04:28 AM
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.