Adding "Jump to ID#" to a list view…

So there have been a few times where a user has wanted to jump to a specific record number in larger lists… This little bit is nice on the top of the page.  Add a content editor web part to the top of your page and add the following code in the source editor:

<script language="javascript">
function SubmitSearchForm()
    {
        var IdToGet = document.getElementsByName("IdSearchField")(0);
        if(IdToGet)
            window.location.href="dispform.aspx?Id=" + IdToGet.value;
    }
</script>

<table cellpadding="5">
<tr>
<td>Enter the ID number to filter on</td>
<td><input type="text" name="IdSearchField" value=""/><input type="button" value="Go" onclick="java-script:SubmitSearchForm()"/></td>
</tr>
</table>

Take out the "-" in java-script above (Blog blocks it as a script otherwise)… :)

Leave a Reply