Solved

How to get string's value ?

Posted on 2009-04-04
2
481 Views
Last Modified: 2012-05-06
I have 2 strings called products_1 and products_2...

I have another string that holds the name products_1 and I'm trying to get into a 3rd string the products_1 value using the products_1 name...

example included
var products_1 = [
	{ id: "1", name: "food" },
	{ id: "2", name: "blah" },
];
 
var products_2 = [
	{ id: "3", name: "asd" },
	{ id: "4", name: "dsa" }
];
 
var catName = 'products_' + ltypeid;
$("#product_suggest").autocomplete(catName);

Open in new window

0
Comment
Question by:OrTzabary
2 Comments
 
LVL 10

Accepted Solution

by:
cyberstalker earned 500 total points
ID: 24067036
This is very easy using an array.
var products_1  =   new Array()
 
products_1[1]   =   "food";
products_1[2]   =   "blah";
 
var catName = products_[ltypeid];
$("#product_suggest").autocomplete(catName);

Open in new window

0
 
LVL 3

Author Closing Comment

by:OrTzabary
ID: 31566555
Thanks..
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question