How to get var ID from dispform.aspx url?

Mikello 81 Reputation points
2020-08-03T20:37:42.227+00:00

For a DispForm.aspx like below, how can I get an ID in Javascript (I'm trying to pass a field value using the ID). Attached is the code where I am trying to get var selectedId

https://server-name/subsite/Lists/listname/DispForm.aspx?ID=20848  

15321-code.txt

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,227 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,575 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerryzy 10,566 Reputation points
    2020-08-04T02:10:53.127+00:00

    Hi @Mikello ,

    I modify the code snippet in the attachment, please check it.

    15334-getid.txt

    Please replace the url in GetParameterValues function with yours so that it will work.

    15353-image-6.png


0 additional answers

Sort by: Most helpful