Solved

How to get string's value ?

Posted on 2009-04-04
2
476 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn how to dynamically set the form action using jQuery.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now