Friday, July 5, 2013

SharePoint Lookup field: - Behaves differently when items greater than 20

SharePoint Lookup field: - Behaves differently when items greater than 20
Lookup column having less than 20 items:
If your lookup column having 20 or less items, the lookup column rendered like a normal dropdown filed (i.e. if you checked the source code of the page, you will get HTML tag <Select title=”File ID”…..) as shown in below images.
1.       The below image showing no. of items less than 20
2.       The below image showing source code for the page

Lookup column having more than 20 items:
If your lookup column is having more than 20 items, the source code automatically changed and complicated in IE browser. In FireFox and other browsers the lookup column with more than 20 items still gets same HTML source i.e. <Select tag .  The images are shown in below:
1.       The below image showing no. of items greater than 20
2.       The below image showing source code for the page
When lookup column has more than 20 items in IE it gets generated INPUT text box with an image. The input field on the other hand having lots of event handler like onfocusout, onkeypress, onkeydown. One of the attributes of input tag is also “Choices” which contains all the ids and values of lookup separated by “|” character. The image next to Input field has an “Onclick” event that triggers the select and selected value pass to the attribute “Value”.

No comments:

Post a Comment