function openDbRelativeURL( url, target ){ //Check we have a target window; target = (target == null ) ? window : target; //Work out the path of the database; path = location.pathname.split('.nsf')[0] + '.nsf/'; target.location.href = path + url; } function doSearch ( s) { var regExp1 = /\bfield\b/; var regExp2 = /[(,),<,>,\[,\]]/; var regExp3 = / /gi; var regExp4 = /\\/gi; var msgWin; var str = s.value; if ( str == "" ){ alert("Please be sure to enter something to search for."); s.focus(); } else { if ( typeof regExp1.source != 'undefined' ) { //supports regular expression testing if ( regExp1.test( str ) || regExp2.test( str ) ){ var alrt = "Please note that you can not include:"; alrt += "\n\n- the reserved word 'field'\n- the characters [, ], (, ), < or >"; alrt += "\n\nin your search query!"; s.focus(); return alert( alrt ); } else { openDbRelativeURL("wait?OpenForm¶m=" + str) } } } } function returnFalse(s){ //guess the field if not supplied s = (s == null) ? document.forms[0].cname : s; //if you want to do the search, use this line doSearch(s); //if you want to alert the user, use this line //alert('Please use the \'Go!!\' button to do a search'); //this line should always be here!! return false; }