JavaScript Function to Trim (Left) Off the Arguments of a URL _________________________________________________________________ function DoStrLeft(origstr, trimchar) { // looks for match of trimchar in origstr, if found returns portion to left, if not found, returns origstr var pos; var tmpString = new String(origstr) // get position for trim pos = tmpString.indexOf(trimchar); if (pos== -1) { // not found, return original str return origstr; } else { // found, return trimmed portion return tmpString.substring(0, pos); } } _________________________________________________________________ Example of Delete Button JS Code: (button code calls above function, above function in JSHeader) if(confirm( 'Are you sure you want to delete this project information form?') == true) { var URL = DoStrLeft(document.location.pathname, "!"); URL = DoStrLeft(URL, "?"); var URLDelete = URL+'!DeleteDocument'; window.location.href = URLDelete }