Putting multiple strings into selectedLookUpsHtml

I am trying to put multiple strings into the selectedLookUpsHtml option of glowLookUpTextBox, but it is not working, like so:

					context.photographer = context.photographer.glowLookUpTextBox({
					delimiter: ',',
					maxValues: 5,
					onGetLookUps: function(tb, searchText) {
						searchUsers(context, tb, searchText, "Photographer");
					},
					emptyHtml: '',
					selectedLookUpsHtml: ["mary","james"],
					deleteImageUrl: ''});	    

and

					context.photographer = context.photographer.glowLookUpTextBox({
					delimiter: ',',
					maxValues: 5,
					onGetLookUps: function(tb, searchText) {
						searchUsers(context, tb, searchText, "Photographer");
					},
					emptyHtml: '',
					selectedLookUpsHtml: context.photogTitle.split(","),
					deleteImageUrl: ''});

Does anyone know the syntax for putting multiple strings in this option?



Edited.
[edited by: IbrahimK at 2:34 PM (GMT 0) on Fri, Sep 18 2020]
Parents
  • The glowLookUpTextBox decorates an input[type="text"] element. The element should have a delimited list of values (you've identified comma delimitation) so you should have 

    <input type="text" id="YOUR_ID" value="value1,value2" />

    The display HTML provided to selectedLookUpsHtml will be matched to the raw values in the textbox to populate the glowLookUpTextBox. If you specified:

    selectedLookUpsHtml: ["mary", "james"]

    Then the resulting glowLookUpTextBox would have two selected lookups: "mary" (with value "value1") and "james (with value "value2").

Reply
  • The glowLookUpTextBox decorates an input[type="text"] element. The element should have a delimited list of values (you've identified comma delimitation) so you should have 

    <input type="text" id="YOUR_ID" value="value1,value2" />

    The display HTML provided to selectedLookUpsHtml will be matched to the raw values in the textbox to populate the glowLookUpTextBox. If you specified:

    selectedLookUpsHtml: ["mary", "james"]

    Then the resulting glowLookUpTextBox would have two selected lookups: "mary" (with value "value1") and "james (with value "value2").

Children