0

var listType = document.getElementById('ddlLists').value; is a string value I want that Dropdownlist value as a property for the function listCreationInfo.set_templateType(SP.ListTemplateType.**listType**); for example

listType="GenericList"

I need it actually as listCreationInfo.set_templateType(SP.ListTemplateType.GenericList);

piyushj
  • 1,546
  • 5
  • 21
  • 29
  • [_An object property name can be any valid JavaScript string, or anything that can be converted to a string, including the empty string. However, any property name that is not a valid JavaScript identifier (for example, a property name that has a space or a hyphen, or that starts with a number) can only be accessed using the square bracket notation. This notation is also very useful when property names are to be dynamically determined (when the property name is not determined until runtime)_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects) – Rayon Jul 06 '16 at 08:06
  • @Rayon Woah, what is that? It looks both like a link, and an answer. If it's an answer, you should post it as an answer ;) – Tim Malone Jul 06 '16 at 08:16
  • @TimMalone, This is more of a dupe which I am unable to find so I preferred to guide OP with reference.. – Rayon Jul 06 '16 at 08:19

0 Answers0