Thursday, November 20, 2008

Displaying record ID in Sharepoint 2003

Put the following javascript in the Dispform.aspx and Editform.aspx:

function urlparm( name ){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\< /a>]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1];}

onetidPageTitle.innerHTML=' <h2 class="ms-pagetitle">ID: '+urlparm("ID")+'</h2>';

No comments:

 
Jeffrey Ting Jeffrey Ting on Facebook Jeffrey Ting on Spock Jeffrey Ting on Plaxo Jeffrey Ting on Spoke Jeffrey Ting on LinkedIn