Java Script snippet to change the width of multi value lookup picker

May 20, 2010 at 7:52 PM
Edited May 20, 2010 at 7:59 PM

If you do want to use CEWB, this is javascript code snippet that will expand the multi value picker field:

<script type="text/javascript">  
var divs = document.getElementsByTagName("div");
for (var i=0; i<divs.length; i++)
{
  if (divs[i].style.width == "143px")divs[i].style.width = "400px";
}
</script>

Script looks for div with length of 143 and replaces it with length fo 400
(div style='width:143px)

 

Example: 

<table class="ms-long" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td class="ms-input">
					<div style='width:143px;height:125px;overflow:scroll'><select name="ctl00$m$g_01520704_faff_4694_a289_4e943ade6d09$ctl00$ctl04$ctl09$ctl00$ctl00$ctl04$ctl00$ctl00$SelectCandidate" id="ctl00_m_g_01520704_faff_4694_a289_4e943ade6d09_ctl00_ctl04_ctl09_ctl00_ctl00_ctl04_ctl00_ctl00_SelectCandidate" multiple="multiple" title="Event possible values" onchange="GipSelectCandidateItems(ctl00_m_g_01520704_faff_4694_a289_4e943ade6d09_ctl00_ctl04_ctl09_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);" ondblclick="GipAddSelectedItems(ctl00_m_g_01520704_faff_4694_a289_4e943ade6d09_ctl00_ctl04_ctl09_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false" onKeyDown="GipHandleHScroll(event)">
						</select></div>