简体   繁体   中英

How to passing more than one parameter in SharePoint url?

This two part question 1) I used http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=26 to Creating a Parent/Child List Relationship in SharePoint 2013 and pass the ID of the Parent to child and auto populate the child ID. What I am looking is how can I pass more column value in addition to ID to the child to the url $(anchorElement).attr("href","javascript:NewItem2(event,'http:///Lists/Time/NewForm.aspx?IssueID=" + issueID + "');");

2) check this part of the code //find the element with the "Add new item" link. //note that if you have more than one list on your page, this just finds the first one var anchorElement = $("a[title='Add a new item to this list or library.']");

how can find the second or third 'Add a new item to this list or library' if I have more than one on a page using jquery or javascript?

I am not sure If I understood all, but in URL You can always add other more parameters separating them with '&' symbol. Like:

http://somehost/somepage.aspx?id=2&name=aaa&othercolumn=bbb

for the second You may try to for over each element like this (to get n-element with some jQuery selector You should use the .eq(n) method):

for(var i = 0; i < $("a[title='Add a new item to this list or library.']").length; i++)
{
    console.log($("a[title='Add a new item to this list or library.']").eq(i).html());
}

I hope this will help :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM