var locate = window.location document.joe.burns.value = locate var text = document.joe.burns.value var res = delineate(text); function delineate(str){ theleft = str.indexOf("?") + 1; theright = str.lastIndexOf("+"); return(str.substring(theleft, theright)); } var zork = res; document.matt.u1.value = zork;