Help: set the list item when scrollbar scrolls

i need help regording how to set the listbox list item to be selected (i.e. item to be highlighted) when the vertical scrollbar scrolls.

Hi Shreyas,
You can insert the code below into the NewForm.aspx page of the list via a Script Editor web part:
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("ready");
function ready()
//12/04/2015 - 18/04/2015
var sd = "";
var ed = "";
var d = new Date();
//get start date of the week
d.setDate(d.getDate() - d.getDay());
sd = convertDate(d);
//get end date of the week
d.setDate(d.getDate() + (6 - d.getDay()));
ed = convertDate(d);
//populate the string into the Title field
var title = document.querySelector("input[title='Title']");
title.value = sd+" - "+ed;
function convertDate(inputFormat) {
function pad(s) { return (s < 10) ? '0' + s : s; }
var d = new Date(inputFormat);
return [pad(d.getDate()), pad(d.getMonth()+1), d.getFullYear()].join('/');
</script>
It will populate the “Title” field with the text like “12/04/2015 - 18/04/2015” based on current date when adding a new item in this list in the NewForm.aspx page:
Here are two links about how to add code into page via Content Editor Web Part:
http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
Thanks 
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]

Similar Messages

  • Ribbon + s4-title s4-lp | Hides when clicked on the list item

    Hello,
    Using
    SPSecurityTrimmedControl, I hide the ribbon for a user having
    view only rights. Now when this user clicks on any list item (grid view), the div "s4-title" containing the logo, and title text hides too.
    Please help.

    Thanks for the reply Shakir.
    I tried to find the div with id ms-designer-ribbon to make the changes and add the JavaScript. I failed to do so. Please helpme with me with this.
    I'll try to explain a bit more:
    The View Only user shouldn't have the ribbon for any editing changes. To achieve this, I followed the steps given in the article (URL below).
    http://blogs.msdn.com/b/zwsong/archive/2010/04/29/how-to-hide-ribbon-from-users-without-edit-page-privilege.aspx
    Now when the user clicks anywhere on "Line Item", the div containing logo i.e.
    <div class="s4-title s4-lp">
    gets hide. There should be some click event on the list items which onclick opens the edit option.
    Any help is appreciated

  • How to Create a Dynamic http address that opens the Explorer Window for a List Item When a Button Is Clicked--Currently Trying to Make this Work with Javascript

    I have created a button (via Content Editor) that uses JavaScript to open the Attachments folder of a list item in the Explorer Window in SharePoint 2010. The purpose is to have drag and drop functionality for each list item, having multiple attachments.
    The button works but opens the "Attachments" folder containing all of the other folders for each list item (one folder per item). It seems that when you add an attachment to a list item, SharePoint numbers the folder based on the item's ID. What
    I'm trying to do is take the JavaScript I have and have it run when a button is clicked in a custom form. When it runs, I'm trying to get it to open the "specific" folder for the list item. I have had success creating a hyperlink in the list that
    does this; however, the link WILL NOT work until I use the Content Editor created button that runs JavaScript, that prompts me to click OK to my profile certificate, and then opens the Attachment folder. After that occurs, I can use my hyperlinks without issue
    because I'm no longer prompted to click OK for my cert.
    So I'm trying to take the JavaScript I have and place it in a list item form (custom form) and have it run when a form button is clicked. The problem is I have very little knowledge of JavaScript (did I mention little?) and
    "don't know how to take the "http:" address I have in the script and append to it the list item ID, according to the record I have open."
    So that for any record I open, the script will grab the corresponding record ID (or list item ID) and append it.
    Here's the script I'm working with (which I didn't create but am grateful for):
    <style>
    .httpFolder {behavior:url(#default#httpFolder);}
    </style>
    <script text = "javascript">
       function fnOpenFolderView(){
       oDAV.navigateFrame("https://server/collection/site/subsite/Lists/Sublist/Attachments","_self");
    </script>
    <div id = "oDAV" class = "httpFolder"/>
    <input type = "button" value = "Open Attachment Folder" onclick = "fnOpenFolderView()"/>
    The above script, in the Content Editor, creates a button that opens the Attachments folder for the corresponding SharePoint list.
    JackSki123

    Hello Thriggle,
    Thank you for pointing that out. I appended your "GetUrlKeyValue" to the end and it worked. That said, I noticed it doesn't run as smoothly as when I simply click on the Content Editor button I created that resides on the SharePoint List
    ASPX page (not the form). The Content Editor button has the same code, minus the "GetUrlKeyValue". I click it; I get prompted to choose my cert; it opens right up.
    Now go to the ASPX Display form where I dump the code in a table cell. Button appears in cell; I click it; wait; wait; I get prompted for cert; it opens. Do I need some sort of "throttle" for the JavaScript? For instance, I thought before running
    JavaScript, you reference the library first. This code doesn't do that. I'm wondering if there's something more I need to make this run smoothly. Thank you both for getting me this far. 
    JackSki123

  • Since installing iOS 7 messages randomly disappear from the message list.  When I scroll through message from 'Fred' has disappeared. I go to 'Fred' in Contacts, send message and there are the messages.  'Fred' messages then re-appear in Message list. Why

    Since installing iOS 7 messages randomly disappear from the messages list.  When I scroll through message from 'Fred' has disappeared. I go to 'Fred' in Contacts, go to send message and there are the messages.  'Fred' messages then re-appear in Message list. Why?  How to stop messages disappearing from message list?  Thoughts?

    Since installing iOS 7 messages randomly disappear from the messages list.  When I scroll through message from 'Fred' has disappeared. I go to 'Fred' in Contacts, go to send message and there are the messages.  'Fred' messages then re-appear in Message list. Why?  How to stop messages disappearing from message list?  Thoughts?

  • Need to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.

    Hi All
    I have one sharepoint list with huge data i.e with 20columns and more than 200 records with the fields .
    Suppose lets consider there are A,B,C,D,E,F,G,H columns.
    Now i want to create one form with the fields A,C,E.
    When the user enter the existing data of list for columns A,C..based on C value the E column value should change and update that particular item in the list.
    Please guide me without visual web part can we acheive this by Sharepoint designer 2013 or what would be the preferable solution.
    Please help me on this as it is very urgent from me..
    Thanks in Advance
    Sowjanya G

    Hi,
    According to your post, my understanding is that you wanted to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.
    I recommend to create workflow associated to the list and then start the workflow automatically when an item is changed.
    In the workflow, you can add condition and actions as below:
    If current item: C equal to Test1
         Set E to Test2
    Then the value of the filed E will be changed based on the value of the filed C.
    In addition, if you create the form using InfoPath, you can add rule to the filed C as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • The workflow could not check out the list item.

    Hi Guys,
    I have a workflow enabled on document library and it needs to started manually.
    Whenever user starts workflow manually, gets following error:
    "the workflow could not check out the list item. Make sure the list item is not checked out." list item is not checked out & this workflow was working smoothly earlier.
    OutCome: The workflow operation failed because the workflow lookup found no matching item.
    I have gone through below links:
    https://christopherclementen.wordpress.com/2014/05/23/oob-approval-workflow-error/
    https://social.msdn.microsoft.com/Forums/office/en-US/f673d0f6-92eb-4057-95ff-ed3cb7790360/the-workflow-operation-failed-because-the-workflow-lookup-found-no-matching-item?forum=sharepointcustomizationprevious
    Any clue on this?
    Thanks, Nilesh

    maybe check out for editing documents setting is turned on so wokrflow needs doc to ce cheked out before proceding and user might not have permission to do that.
    please refer below link:
    http://sharepoint.stackexchange.com/questions/32399/workflow-error-the-workflow-could-not-update-the-item-possibly-because-one-or
    http://community.office365.com/en-us/f/154/t/243062.aspx
    http://stackoverflow.com/questions/1272957/document-checked-out-in-sharepoint-when-workflow-starts
    Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing

  • How to set the default item showed in a h:selectonemenu

    I need to show the second, or the third, and on so.
    i tried some ways to set the default item showed in it, but failed.
    i had tried the attribute value, but it stiil showed the first item.
    Can u help me?
    in the JSP
    <h:selectOneMenu id = "companyName" rendered="true" binding="#{j03CMSyainAddBean.selectCompany}" style="width:150">
           <f:selectItems value="#{j03CMSyainAddBean.companyList2}"/>
    </h:selectOneMenu>in the back BEAN
    private UISelectOne selectCompany;
    private ArrayList companyList2;In the ArrayList companyList2, there are several selectItems.
    Thanks
    George

    Sanjeev K Sharma wrote:
    and without messing with /boot/grub/grub.cfg  ?
    I need this so that new kernels show up but do not change the default boot kernel
    Is there a way to do it by file name instead of position within the menuentry / submenu list?
    I found some ubuntu and fedora sugestions but all by position, none by name
    AND how to set the kdump kernel as the default?
    Arch is putting this kernel under a submenu - would this pose problems for setting it as the default?
    In /etc/default/grub you can use the name of your entry you wish to use as default
    GRUB_DEFAULT='Arch Linux, with Linux core repo kernel'
    You can tell grub to stop using submenus by doing:
    GRUB_DISABLE_SUBMENU=y
    Or you can just make a purely custom menuentry in /etc/grub.d/40_custom if you'd like:
    menuentry "Other Linux" {
    linux <KERNEL IMAGE HERE>
    initrd <INITRD IMAGE HERE>
    EDIT: /etc/grub/default -> /etc/default/grub
    Last edited by Slabity (2015-04-07 11:16:22)

  • How to display the Attachment(picture) on the list item page?

    I have attached a picture to the list item and then when I click the item, there is a link of the attachment but not the picture graphics! I want to display the picture on the list item page and how to do it?
    I am a beginner of SharePoint 2010 and my English is not very good! Thanks!

    Hi,
    Using few easy steps you can set image in your out of the box List View, Edit and View Item Page.
    1. Create one Picture type Column in your list.
    2. Just create one Event Handler with Item
    /// <summary>
    /// An attachment was added to the item.
    /// </summary>
    public override void ItemAttachmentAdded(SPItemEventProperties properties)
    base.ItemAttachmentAdded(properties);
    SPListItem item = properties.ListItem;
    //SPAttachmentCollection attach = item.Attachments;
    string attachmentUrl = item.Attachments.UrlPrefix + item.Attachments[0];
    item["PictureColumnName"] = attachmentUrl;
    item.Update();
    Now, just add item with attachment and you will see attached image in Picture Column field.
    Manoj | SharePoint

  • Error: "The workflow could not delete the list item"

    Have set up 2 lists:  Events and EventsArchive.  They have all the same fields.  I have created a workflow in SPD using an impersonation step (I have Full control of the site/site collection).  Workflow is essentially this:
        If Curent Item:Expired 
    equals
    Yes
           Copy item in Current Item to
    EventsArchive
           then Delete item in
    Current Item.
    The item is copying over to the EventsArchive list just fine, but the "delete" part is not happening.  Instead, I get the following error:
    The workflow could not delete the list item. Make sure the list exists and the user has permissions to delete items in the list.
    The list obviously exists (or I wouldn't be able to copy an item from it), and I have as much permissions as anyone can have, so I'm not sure where else to turn with this. 
    Thanks in advance for your help!

    Hi,
    To test the issue, I create a simple workflow without using Impersonation step:
    It works.
    Could you please create new lists to avoid custom settings and test the issue again?
    Similar thread:
    https://social.msdn.microsoft.com/Forums/office/en-US/3fa94026-4487-4e4c-a5b4-12a79d6ee6a2/workflow-delete-item-not-working?forum=sharepointcustomizationprevious
    Regards,  
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Termstore changes are not getting reflected in the list items in SharePoint 2010 farm environment

    Hi,
    I had created managed metadata with termstores from central admin. Then I had created one list in which added a column of type managed metadata using the managed metadata which I had created. And also added few list items to this list.
    The problem is that after updating a termstore the changes are not reflecting in the list items which were added before the update.
    I have referred the following links:
    http://www.paulgrimley.com/2011/02/managed-metadata-changes-not-applied-to.html
    http://davidfrette.wordpress.com/2010/05/26/taxonomy-update-scheduler%C2%A0timer%C2%A0job/
    According to the links we need to run Taxonomy Update Scheduler on the server for updated termstore to get reflected. After running
    this scheduler on development environment changes are getting reflected but not working on the production environment.
    Kindly help!
    Regards, Shruti

    You should check the obvious.  You made the change in dev, but did you make the change in production too?  And, is the term you updated, actually the one that you are looking at in the list item?
    There is not much, if anything, that can go wrong with that timer job. so I'd guess that the term you are looking at is not the one you think you are updating.
    If you have double checked everything (the term is is in fact the same term id), then you may have something erroring in the update process.  In this case, you should check the ULS logs for any errors.
    Chris
    Chris Givens CEO, Architecting Connected Systems
    Blog Twitter

  • How i can set the selected item of a dropDown component from java code

    Hi
    Thank you for reading my post
    How i can set the slected item of a DropDown component from backing beans java code ?
    it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
    In back code i have both value and display values to use them .
    can some one give me some help ?
    Thanks ,

    See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
    It says
    One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back.

  • How to allow user defined in list item to see item using only Designer. Approver set in list item can't see items they are to approve.

    SharePoint 2010 and Designer 2010.
    We have a list of items that users enter information into. Only the user who enters the data can see the item. It's confidential stuff. 
    One field is the name of the person who will approve this record.
    Workflow sends approver an email and sets a task to approve the item. 
    Problem is that the user set as approver cannot see the item. 
    We can't have a list of approvers - as all staff can potentially be approvers.
    We can't allow anyone other than the person who created the item and the person that is set as approver in a field to have access. 
    I am not a programmer, but a user of SharePoint Designer 2010. 
    (I did think we had this sorted by sending an email containing all the list item fields, but this task still requires permissions). 

    Hi ,
    I understand that after you grant user permission on current item ,the user still cannot approve the workflow task .This is because the user doesn't have approve permission in the Tasks list .You only grant the user permission on current item in current
    list ,so he can approve the item by clicking the Approve/Reject in the edit control block .
    Your workflow is correct ,now you need to grant the users Approve (a permission level) permission in the Tasks list settings .In this way ,the users can finish the tasks .
    Thanks
    Entan Ming
    TechNet Community Support

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

  • WebPart is raising the following error "Invalid data has been used to update the list item.The field you are trying to update may be read only"

    I have created a farm solution and then i deploy it to SharePoint server, the code looks as follow, and i use it to update a page info values (as the current page values represents old info):-
    [ToolboxItemAttribute(false)]
    public partial class VisualWebPart1 : WebPart
    // Uncomment the following SecurityPermission attribute only when doing Performance Profiling using
    // the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
    // for production. Because the SecurityPermission attribute bypasses the security check for callers of
    // your constructor, it's not recommended for production purposes.
    // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
    public VisualWebPart1()
    protected override void OnInit(EventArgs e)
    base.OnInit(e);
    InitializeControl();
    using (SPSite site = new SPSite(SPContext.Current.Site.Url))
    using (SPWeb web = site.OpenWeb())
    SPList list = web.Lists["Pages"];
    web.AllowUnsafeUpdates = true;
    foreach (SPListItem items in list.Items)
    items["Author"] = "SharePoint";
    items["Created"] = "01/08/2014 01:44 PM";
    items.Update();
    list.Update();
    web.AllowUnsafeUpdates = false;
    protected void Page_Load(object sender, EventArgs e)
    but when i try adding this web part to a page i got the following error:-
    Invalid data has been used to update the list item.The field you are trying to update may be read only
    so can anyone advice?

    i only changed lines bitween 
    web.AllowUnsafeUpdates = true;
    and
    web.AllowUnsafeUpdates = false;
    and other parts of code remains without change
    so it will updates all pages in current web
    yaşamak bir eylemdir

  • Invalid data has been used to update the list item. The field you are trying to update may be read only (Lookup Field).

    Hi.
    I am getting below error while adding value to look-up field.
    Invalid data has been used to update the list item. The field you are trying to update may be read only.
    I have tried many forums ans post but didn't come to know what's the root cause of issue. I am also posting Code for creating and adding lookup field.
    CAML to create lookup field (It works Fine)
    string lkproductNumber = "<Field Type='Lookup' DisplayName='Product Number' StaticName='ProductNumber' ReadOnly='FALSE' List='" + pNewMaster.Id + "' ShowField='Product_x0020_Number' />";
    Code to insert value to lookup field
    ClientContext client = new ClientContext(SiteUrl);
    client.Load(client.Web);
    client.Credentials = new NetworkCredential(this.UserName, this.Password, this.Domain);
    // Lookup Lists
    List pmList = client.Web.Lists.GetByTitle("Product_Master");
    //List Conatining Lookup Columns
    List piList = client.Web.Lists.GetByTitle("Product_Inventory");
    client.Load(piList);
    query.ViewXml = "<View/>";
    ListItemCollection collection = pmList.GetItems(query);
    client.Load(collection);
    client.ExecuteQuery();
    int prodid=0;
    foreach (ListItem item in collection)
    if (Convert.ToString(item["Product_x0020_Number"]) == ProductNumber)
    { prodid = Convert.ToInt32(item["ID"]); }
    ListItem piItem = piList.AddItem(new ListItemCreationInformation());
    piItem["Product_x0020_Number"] = new FieldLookupValue() { LookupId = prodid };
    piItem.Update();
    client.ExecuteQuery();
    Exception Detail
    Microsoft.SharePoint.Client.ServerException was caught
    Message=Invalid data has been used to update the list item. The field you are trying to update may be read only.
    Source=Microsoft.SharePoint.Client.Runtime
    ServerErrorCode=-2147352571
    ServerErrorTypeName=Microsoft.SharePoint.SPException
    ServerStackTrace=""
    StackTrace:
    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
    at WebServiceProviders.ClientServices.NewProductInventory() in Z:\.............ClientServices.cs:line 889
    InnerException:
    Quick response is highly appreciated.
    Thanks
    Mehar

    Try some thing like below,
    your data value that needs to be update should be in this format "ID of the lookup";#"Title of the Lookup" 
    For example,
    listItem["Product_x0020_Number"]
    = "1;#iPhone";
    listItem["Product_x0020_Number"]
    = "2;#Mobile";
    Hope this helped you....

Maybe you are looking for

  • How do I get rid of someone else's apps on my account?

    A few months ago I synched my new iPhone with my computer at work. It seems that, unknown to me at the time, someone had used the itunes on my computer to update their iPad. Suddenly, I had one million apps on my phone that I had never downloaded. It

  • Reference document number of 103 movement not seen in 105 movement documnt

    Dear all, I have made a material document with movement type 105 with reference to 103 document. After creation, the field LFBNR in the 105 document is not updated with the 103 document number. In all other cases the document number of 103 movements

  • Xml parser Errror  While Depoying

    Hi, Iam trying to deploy an ear file which contains some jar files in web-inf/lib such as xerces.jar,soap.jar,saaj-api.jar,dom4j.jar etc. In the web.xml we are trying to access some Xml api's as an init param.(web.xml attached). While Deploying for t

  • Session control via terminal services

    I have an application running like a dream using JSP and server side session control. One paricular user has an environment where all PCs are linux based and running a terminal service from a Microsoft SBS server. These PCs are unable to maintain ses

  • M4.0 doesn't open fully a not work, so it's almost totally blank and black??

    I loaded the new 4.0 and it not open at all totally, why? The display is almost all black/blank(white) or without text? I tried to load 4.0 twicw, doesn't help. Do I need to load M3.6 back? Please ASAP reply?