How to read list item and display Title and on click hyperlink as value by javascript /jquery

on newform.aspx just above the top of cancel button I want to put 1 hyperlink "Help"
but I want to do this by script/jquery by reading my configuration list where 1 column is TITLE and other is- URL
in TITLE column will write "Help" and in URL column  I will write
http://portal1234/sites/sudha/MyHelppage.aspx
so script should read Title and display Help--->1st part
Script should read Value column and on click of help-(display link) the respective url should be open in new window.-->second part
Please let me know reference code for adding anchor tag dynamically by reading from list
I can see hyperlink near cancel button-
$(document).ready(function(){
var HelpLinkhtml ='<a href="#" text="Help">Help</a>';
var position =$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
now for reading from list I am trying below script-
$(document).ready(function() {
    GetHelpLinkFromConfigList();
function GetHelpLinkFromConfigList()
 //The Web Service method we are calling, to read list items we use 'GetListItems'
 var method = "GetListItems";
 //The display name of the list we are reading data from
 var list = "configurationList";
 //We need to identify the fields we want to return. In this instance, we want the Title,Value fields
 //from the Configuration List. You can see here that we are using the internal field names.
 var fieldsToRead = "<ViewFields>"+"<FieldRef Name='Title' />"+"<FieldRef Name='Value' />"+"</ViewFields>";
 //comment
 var query = "<Query>" +
                        "<Where>" +
                            "<Neq>" +
                                "<FieldRef Name='Title'/><Value Type='Text'>Help</Value>"
+
                            "</Neq>" +
                        "</Where>" +
                        "<OrderBy>" +
                            "<FieldRef Name='Title'/>" +
                        "</OrderBy>" +
                    "</Query>";
 $().SPServices(
 operation: method,
    async: false,
    listName: list,
    CAMLViewFields: fieldsToRead,
    CAMLQuery: query,
    completefunc: function (xData, Status) {
    $(xData.responseXML).SPFilterNode("z:row").each(function() {
    var displayname = ($(this).attr("ows_Title"));
    var UrlValue = ($(this).attr("ows_Value")).split(",")[0];
    AddRowToSharepointTable(displayname,UrlValue)
function AddRowToSharepointTable(displayname,UrlValue)
    $("#NDRTable").append("<tr align='Middle'>" +
                                "<td><a href='" +UrlValue+ "'>+displayname+</a></td>"
+
                               "</tr>");
<table id="NDRTable"></table>
Thanks :)
sudhanshu sharma Do good and cast it into river :)

Hi,
From your description, you want to add a help link(read data from other list) into new form page.
The following code for your reference:
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(AddHelpLink, "sp.js");
function AddHelpLink() {
var context = new SP.ClientContext.get_current();
var list= context.get_web().get_lists().getByTitle("configurationList");
var camlQuery= new SP.CamlQuery();
camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>Help</Value></Eq></Where></Query></View>");
this.listItems = list.getItems(camlQuery);
context.load(this.listItems,'Include(Title,URL)');
context.executeQueryAsync(function(){
var ListEnumerator = listItems.getEnumerator();
while(ListEnumerator.moveNext())
var currentItem = ListEnumerator.get_current();
var title=currentItem.get_item("Title");
var url=currentItem.get_item("URL").get_url();
var HelpLinkhtml ='<a href="'+url+'">'+title+'</a>';
$("input[value='Cancel']").parent("td").addClass('ms-separator').append(HelpLinkhtml);
},function(sender,args){
alert(args.get_message());
</script>
Result:
Best Regards
Dennis Guo
TechNet Community Support

Similar Messages

  • How do I remove reading list items?

    How do I remove reading list items?

    Hello,
    In your reading list, just move your mouse pointer on the item and a small x will appear at the left of the title. Click on it to delete the selected item.

  • TS4001 How to delete reading list in the book mark and history

    How to delete in bookmark and reading list in safari in Ipad and iphone4

    Swipe across an item in the reading list and it should get a Delete button on it - you will need to do each individually, I don't think that there is a multi-select-and-delete option

  • How to sync reading list between my old tablet and new one?

    I have like 100 links in my reading list in firefox on my old tablet. I need to transfer them to my new tablet, but it seems that Firefox sync is working only for bookmarks. How can I transfer my reading list without rooting the device?

    Hello.
    Currently, there is no way to sync your reading list between your devices. Since the reading list is just webpages without all of the ads and a more reader-like experience, it's just like a bookmark. But, you have to make all of those reading list items into bookmarks to sync between devices. The reading list is for on-device only.
    Sorry for all of the trouble. (With 100 and all) :-(

  • Touch3G, ios 5.1.1, how to get rid of "reading List" in the bookmarks section and history file in reading list no longer works.

    Since downloading 5.1.1, my Touch 3G has "Reading List" in the Bookmarks section and the "history" tab no longer shows anything. 
    How do I delete "reading list" in the bookmarks section?  Very disappointed to have this pushed on me without warning. TIA....

    Please can u answer it fast

  • Please tell me how to handle list item in this concern

    please tell me how to handle list item in this concern
    My problem is:
    i have a category table with column categoryname(varchar type)
    I want to display the records of categoryname in a drop down list (i.e., list item )
    So ..please tell me how to do it
    Thanks in advance..

    This code is just a sample from the Help documentation. It won't work until you modify it for your form.
    Why do you have "steps" in your code? You are suppose to do what the steps tell you. You don't place the steps in your code. The steps must be removed from your code.
    Step 1 code goes in a program unit, not in a trigger.
    Step 2 and 3 code usually goes in a trigger.
    You will have to replace the names of the items and record group with your own names as you have defined them in your form.
    step 1: create a procedure in your application
    procedure load_list(itm in VARCHAR2, rg in VARCHAR2) is
    group_id RecordGroup := Find_Group(rg);
    list_id Item := Find_Item(itm);
    Begin
    if Populate_Group(group_id)<>0 then
    Message('Unable to populate record group');
    Raise Form_Trigger_Failure;
    end if;
    Clear_List(list_id);
    Populate_list(list_id, group_id);
    end;
    step 2: create a record group named rg_cat and assign Record Group Query to something like "select categoryname from category"
    step 3: call this procedure as
    load_list('categoryname','rg_cat');

  • How to populate List Item from the table in a form builder

    I want to know how to populate the List Item (pop up menu and combo box) from a table.
    Supposing I have a table Customer(cust_id,cust_name)
    and now I want to populate it in such a manner that I can update the data back to the database and also access the list on the form.

    This is the method i am using to populate a list.
    1- First of all you need to create a non-database list item for customer_name.
    2-create this procedure
    PROCEDURE populate_list_with_query
    --Populates the given list item with the specified query.
    (p_list_item in VARCHAR2
    ,p_query in VARCHAR2)
    IS
    /* Name the record group after the list item (no
    block prefix). */
    cst_rg_name constant VARCHAR2(30) :=
    GET_ITEM_PROPERTY(p_list_item,item_name);
    v_rg_id RECORDGROUP;
    BEGIN
    v_rg_id := FIND_GROUP(cst_rg_name);
    IF ID_NULL(v_rg_id) THEN
    v_rg_id := CREATE_GROUP_FROM_QUERY(cst_rg_name,p_query);
    END IF;
    IF POPULATE_GROUP(v_rg_id) = 0 THEN
    POPULATE_LIST(p_list_item,v_rg_id);
    /* Force display of first list element label
    in the list item. */
    COPY(GET_LIST_ELEMENT_VALUE(p_list_item,1),p_list_item);
    END IF;
    END populate_list_with_query;
    3- Create When-Create-Record on the block level and write this code
    BEGIN
    POPULATE_LIST_WITH_QUERY('bk1.customer_name',
    'SELECT customer_name, to_char(customer_id) FROM customer');
    END;
    In this example, the customer name is the (visible) list label and the customer ID is the (actual) list value
    i hope this will solve your problem ...

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    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]

  • How to get List Item attachments name without write any custom code or any database query?

    Hi,
    How to get List Items attachments name without write any custom code or any database query?

    You can get it from Rest,
    There are 2 options,
    1) create a 'Result Source' which has a search query for that List which has attachments 
     - Use rest query to get the 'Filename' , it will have the attachment file name 
    For example, if the result source id is : 73e6b573-abf8-4407-9e5f-8a85a4a95159 , then the query will be 
    http://[site URL]/_api/search/query?querytext='*'&selectproperties='Title,Path,FileExtension,SecondaryFileExtension,Filename'&sourceid='73e6b573-abf8-4407-9e5f-8a85a4a95159'&startrow=0&rowLimit=100
    You can refine the query, be giving proper 'querytext'
    2) Use the List rest api
    For example if your list guid is :38d524a1-e95c-439f-befd-9ede6ecd242e
    You can get he attachments for 1st item using this 
    http://[Site URL]/_api/lists(guid'38d524a1-e95c-439f-befd-9ede6ecd242e')/items(1)/AttachmentFiles
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • Tutorial on how to update list items using ListData.svc

    Can you please point me to a tutorial which shows how to update a list item using listdata.svc and C#?
    Sorry if this is FAQ.
    I have found articles on read list... but I haven't found anything on update a list item.
    val it: unit=()

    when i try this I get an error 500
    I created an ASP.NET web application that allows the user to modify data that is stored in SharePoint I rather not go into the reasons why this application was created but focus more on why doesn't the listdata.svc allow me to update a task item that was
    created by a workflow collect data from user action.
    1. The workflow creates the item.
    I collect the item and update the item using the below code. This is not an OOTB approval workflow that is just the name I used. When I get to save changes I received the following error code.
    Dim getApprovalItem As ExpenseApprovalRuleBasedTasksItem = spContext.ExpenseApprovalRuleBasedTasks.Where(Function(i) i.Id = Pam.ApprovalItemID).FirstOrDefault
    If String.IsNullOrEmpty(getApprovalItem.AuditorApprovalValue) Then
    getApprovalItem.AuditingComments = approvalComments
    Select Case approvalDecision
    Case "Approved"
    getApprovalItem.AuditorApproval = ExpenseApprovalRuleBasedTasksAuditorApprovalValue.CreateExpenseApprovalRuleBasedTasksAuditorApprovalValue("Approved")
    getApprovalItem.AuditorApprovalValue = "Approved"
    Case "Rejected"
    getApprovalItem.AuditorApproval = ExpenseApprovalRuleBasedTasksAuditorApprovalValue.CreateExpenseApprovalRuleBasedTasksAuditorApprovalValue("Rejected")
    getApprovalItem.AuditorApprovalValue = "Rejected"
    End Select
    getApprovalItem.Outcome = "Completed"
    getApprovalItem.Status = ExpenseApprovalRuleBasedTasksStatusValue.CreateExpenseApprovalRuleBasedTasksStatusValue("Completed")
    getApprovalItem.StatusValue = "Completed"
    getApprovalItem.Complete = True
    spContext.UpdateObject(getApprovalItem)
    spContext.SaveChanges()
    End If

  • How Can I have the MB display (1280X800) and a  1440 x 900 ext not in miror

    How Can I have the MB display (1280X800) and a 1440 x 900 ext not in miror mode ???
    I have a Lenovo external display :
    H19-inch (483-mm) viewable image size
    Optimum resolution: 1440 x 900
    Tilt stand for viewing comfort adjustments
    16 x 10 aspect ratio
    Analog attachment

    I just bought a wide screen display that also uses 1440 X900 resolution. In mirror mode mine also only allows a maximum of 1280 X ???. I think may be a limitation of the GMA 950 graphics chip set. I never use it in mirrow mode so it doesn't bother me. I prefer extended mode. That way I can keep more windows open and visible.
    I use the question mars because on mine I can use 1280 X any of the resolutions that go with it.

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How to read list of all files in folder on application server?

    How to read list of all files in folder on application server?

    Hi,
    First get the files in application server using the following function module.
        CALL FUNCTION 'RZL_READ_DIR_LOCAL'
          EXPORTING
            name     = loc_fdir
          TABLES
            file_tbl = int_filedir.
    Here loc_fdir contains the application server path.
    int_filedir contains all the file names in that particular path.
    Now loop at int_filedir.
    OPEN DATASET int_filedir-name FOR INPUT IN TEXT MODE ENCODING  DEFAULT MESSAGE wf_mess.
    MESSAGE wf_mess.
        IF sy-subrc = 0.
          DO.
            READ DATASET pa_sfile INTO wf_string.
            IF sy-subrc <> 0.
              EXIT.
    endif.
    close datset int_filedir-name.
    endloop.

  • I have finally figured out how to export an iphoto album so that I can maintain the proper order of the photos after burning the file. How do I keep each individual photo title and description after exporting and burning?

    I have finally figured out how to export an iphoto album so that I can maintain the proper order of the photos after burning the file. How do I keep each individual photo title and description after exporting and burning?  Presently after exporting and burning each photo is identified by the file name rather than each individual title description.  

    File name and Title are not the same thing.
    Filename is attached to the Jpeg file in the Finder.
    Title is attached to the photo within the Jpeg file - as is the description. These are written to the Exif and IPTC metadata on export.
    So: File -> Export. Kind: Jpeg or Tiff and Check the box at 'Title and Keywords'. This will write the Title, keywords and descriptions (though not explicitly stated) to the metadata. This can then be viewed in any app that understand this material.
    You can choose, if you wish, to also use the Title as a Filename - that's an option at File Name
    Regards
    TD

  • Now that the photo gallery in MobileMe is ending, is there another photo sharing site to which existing iPhoto albums can be transferred as is, with photos in the same order and with titles, and with minimal problems?

    Now that the photo gallery in MobileMe is ending, is there another photo sharing site to which existing iPhoto albums can be transferred as is, with photos in the same order and with titles, and with minimal problems?

    No. If you don't have the album you originally used to create the galleries you can do so by dragging the photos from each gallery to a new, empty album. Then when you find the photo sharing site/option you have decided on  you can easily upload each album to the site.
    Another option is to obtain a hosting service and create iWeb photo pages for each album and future albums similar to this photo page in one of my demo sites: iPhoto Book as an iWeb Slideshow.  Or you can use the iWeb album page and have an album for each  iPhoto album on it like on this demo page: Page-7 .
    OT

Maybe you are looking for

  • Class or function module to create a resubmission

    Hallo, can anyone give me an example for generate a resubmission via ABAP-Code? I'll develop a WebDynpro application for contracting and when I save I'll generate automatical the resubmission. thank you! Greetings Martin

  • Unable to automatically assign batch numbers in REM upon confirmation

    Hi expert, I did all required configuration: the batch level is Material (OMCT) internal Batch Number Assignment is activated (OMCZ) Define Batch Creation For Mvt is set to C for type 131 Define Initial Creation of Data for Batch Master Transactions

  • E71 signal

    every morning i have to turn my e71 off because it has lost signal over night it did this for a couple of weeks so i took it back to 3 my network provider and they gace me a new one now this one is doing the same. i know it the handset because i neve

  • Hierarchies of distincts

    Dear all, I have to create a cube where I count my active customers per timeframe. The simplest design would be to put a line for each active customer linked to a time dimension into the cube. Something like customer_no(dimension_key for customer dim

  • XI Mapping not opening

    Hi Folks,              I am not able to open any of my mapping objects or create new ones. I get this java error . has anybody faced this issue before ?? I am on PI 7.1 SP6 com.sap.aii.ib.bom.gen.container.ContainerHelper; local class incompatible: s