This project has moved and is read-only. For the latest updates, please go here.

How to get the Selected Item Row ID(ListItem ID) from The ListView?

May 21, 2012 at 7:41 AM

I am updating the share point list using jquery

<script src="../Style%20Library/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="../Style%20Library/jquery.SPServices-0.7.1a.min.js" type="text/javascript"></script>
<script type="text/javascript">

function updateListItem(){


operation: "UpdateListItems", 

 listName: "Meeting", 

 ID: "243", 

valuepairs: [["Completed", 'Yes']], 

 completefunc: function (xData, Status) {alert(Status);}



How to pass the selected Item ID dynamically?

May 22, 2012 at 4:00 AM

Just assign the value you want to a variable and use that variable in place of "243" in your example.

I would suggest that you use a more current version of jQuery, preferably 1.7.0+.


May 22, 2012 at 9:20 AM

Thanks for the Reply.

But as I mentioned I need to get the list item ID of selected row. How to pass the checked item ID?

May 22, 2012 at 12:20 PM

Actually, you didn't mention that. ;+)

It's hard to say exactly, since I can't see your list. If you are displaying the ID, then it's pretty easy to select it in the DOM and grab the value. If you aren't showing the ID, then it may be embedded in one of the other column values and you can parse it out.


May 22, 2012 at 1:50 PM
Edited May 22, 2012 at 1:53 PM

This is my OOB List View Webpart. I added a button through SharePoint Designer


The below Jquery Value for ID is coming Undefined

$('input[title= "ID"]').val(this.value);

The below Jquery Value is coming Undefined

    if(this.checked == true)
      selectedItems += $(this).attr("id") + ",";

Any Idea?