DropDown LookUp problem - not appearing undering dropdown box
We have rebranded our sharepoint site. Since the rebrandwe have a problem when a user has aselect box.When the user clicks on the dropdown box to see the values it displays the lookup box but it is offset from the dropdown box.I have looked into the code and it appears something is basing a calculation where to position this box, obviously the calculation is incorrect.Any ideas on a fix for this?Attached is a link to the image of the problem, i have blurred out data for obvious reasons.http://www.cmbi.co.uk/images/error_forms.jpg
March 26th, 2009 5:15pm

This is a CSS issue - I'm not 100% sure what in the CSS will cause it though (I believe it is linked to the way some positioning is done in you master page). What I did when I had a similar issue was to look at taking the cusotmisations away and going back to the standard default.master, and then little by little working my way back to the new design by adding elements and styles until I found the problem. It wasn't pretty but it got it done, I just don't remember what caused it in the end! I hope that gives you a little help though.Brian Farnhill Microsoft Certified Application Developer blog.brianfarnhill.com Canberra SharePoint User Group
Free Windows Admin Tool Kit Click here and download it now
March 29th, 2009 11:14pm

Are you using IE or FireFox?!It's definitely CSS issue. I recommend to use IE Dev Toolbar or FireBug (FF) to find the CSS class responsible for this and fix itSharePoint Tips & Tricks | Microsoft MVP | My twitter
March 30th, 2009 9:31am

Hi guys,yeah i know it's CSS issue. Like i said, a script seems to calculating where to position the dropdown. It must be looking for a parent div or table to base it's calculation where to position.Does anyone know where this script is, which js file?Cheers.
Free Windows Admin Tool Kit Click here and download it now
April 1st, 2009 12:13pm

Open you page in SharePoint designer (or master.page), and you will find all references to JS scripts in the very beginninSharePoint Tips & Tricks | Microsoft MVP | My twitter
April 1st, 2009 12:31pm

I'm pretty sure its in core.js - use the script debugger in IE/VIsual Studio and you should be able to find it pretty easilyBrian Farnhill MCAD | MCTS blog.brianfarnhill.com Canberra SharePoint User Group
Free Windows Admin Tool Kit Click here and download it now
April 1st, 2009 11:00pm

Found it..........................function ShowDropdown(textboxId){var ctrl=document.getElementById(textboxId);var str=ctrl.value;var opt=EnsureSelectElement(ctrl, ctrl.opt);ctrl.match=FilterChoice(opt, ctrl, "", ctrl.value);ctrl.focus();}but it didn't fix my problem.
April 7th, 2009 2:59pm

Ok the plot thickens. I have worked out, that the hidden drop down is getting placed as follows: left: 361px; top: 346px; Using the old master pages this would position the hidden div correctly. There must be starting point that the script references, i.e body at 0px 0px; does anyone know what ID/tag the script will be referencing?
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2009 12:40pm

The best way I have found to make sure a lookup field is rendered as a select box, rather than that quirky thingSharePoint likes to insert,is to change thebound control in the XSL from "SharePoint:FormField" to "SharePoint:DVDropDownList".You then have to add an extra data source to populate the dropdown options, but I've found this to be usefull too, since you can sort and filter the items in the list.This is more like the traditional dropdown binding scenario - get the list of options from the lookup table and populate the selected choice from the proper field in the "main" table. The wierdo thing here is that the DVDropDownList control doesn't look as if it is bound to the "main" table (or, in this case, List) because of the esoteric syntax of the ddwrt:DataBind method. Oh, well...Solution Steps: 1. Add a new "SharePoint:SPDataSource" to the web part that points to the list containing the lookup items 2. Replace the "SharePoint:FormField" control with a "SharePoint:DVDropDownList" (I just leave the old control and overwrite the element) 3. Change the appropriate element attributes (see code section) 4. Updatethe ddwrt:DataBind call to pull input from the new DVDropDownList control 5. ! Note that in ddwrt, "i"is forinsert and "u"is for update Code: <!-- Here's the new SPDataSource for the lookup: --> <SharePoint:SPDataSource id="Regions1" runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;/View&gt;"> <SelectParameters> <WebPartPages:DataFormParameter Name="ListName" ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Regions"/> </SelectParameters> </SharePoint:SPDataSource> <!-- This is the ORIGINAL control for comparison --> <SharePoint:FormField runat="server" id="ff11{$Pos}" ControlMode="New" FieldName="Regions" __designer:bind="{ddwrt:DataBind('i',concat('ff11',$Pos), 'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Regions')}" /> <!-- And here is the NEW control, which will render as a SelectBox --> <SharePoint:DVDropDownList runat="server" id="ff11{$Pos}" DataSourceID="Regions1" DataTextField="Title" DataValueField="ID" SelectedValue="{@Region}" __designer:bind="{ddwrt:DataBind('i',concat('ff7',$Pos), 'SelectedValue','SelectedIndexChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Region')}" /> Hope this helps. It is a rather ridiculous work-around, but that's SharePoint for you...
April 29th, 2009 10:20pm

Hi,I have the exact same problem. Has anyone found the solution using CSS?Thanks.
Free Windows Admin Tool Kit Click here and download it now
June 18th, 2009 5:03pm

Definitely a CSS probelm I had this in my style sheet and removing it fixed the problem. I found it by gradually adding and removing parts of my style sheet. (binary search of sorts!). Good luck.div.contentPlaceHolder {position: relative;}Alain BLanchette
December 9th, 2009 8:50am

div.contentPlaceHolder {position: relative;} Is not the answer! The problem is if you choose to use "divs" to style sharepoint and use "position: absolute" in your CSS this creates a problem with the Javascript for the dropdown menu, thecalculationwhere to position the dropdown is incorrect thats why it misplaces the dropdown. I have fixed my problem by going back to using a table to create the main layout, not my preferred choice but if your using Sharepoint it seems the best way to create your design.
Free Windows Admin Tool Kit Click here and download it now
December 9th, 2009 3:44pm

I faced similar issue copied the style from - Randy Drisgill publishing master page and it worked. <style type="text/css"> /* fix scrolling on list pages */ #s4-bodyContainer { position: relative; } /* hide body scrolling (SharePoint will handle) */ body { height:100%; overflow:hidden; width:100%; } /* popout breadcrumb menu needs background color for firefox */ .s4-breadcrumb-menu { background:#F2F2F2; } /* if you want to change the left nav width, change this and the margin-left in .s4-ca */ body #s4-leftpanel { /* width:155px; */ } /* body area normally has a white background */ .s4-ca { background:transparent none repeat scroll 0 0; /* margin-left:155px; */ } </style>Faraz Javaid
February 4th, 2011 10:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics