function doSearch ( s ) { var regExp1 = /\bfield\b/; //used to test for reserved word field in query string var regExp2 = /[(,),<,>,\[,\]]/; //used to test for reserved char(s) in the query string var str = s.value; if ( str == "" ){ alert("U dient iets in te vullen in het zoekveld."); 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\nThe reserved word 'field'\nthe characters [, ], (, ), < or >"; alrt += "\n\nin your search query!\n\nIf you are confident that you know"; alrt += "\nwhat you are doing, then you can\nmanually produce the URL required." s.focus(); return alert( alrt ); } document.location = "/nwohome.nsf/pages/zoekresultaat?opendocument&subfrm=search&query=" + escape( str ); } }