New Response

« Return to the main article

You are replying to:

  1. I am quite good with LotusScript , but a true novice with JavaScript. I think I followed the whole discussion I am using a $$ViewTemplate (no options selected ie not generating HTML for all fields) I have removed the Notes Query field

    Here is the current Javascript function doSearch ( s ) { var regExp1 = /\bfield\b/; var regExp2 = /[(,),<,>,\[,\]]/; 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\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 ); } viewName = (window.location.pathname.split('.nsf/'))[1] openDbRelativeURL(viewName + "?SearchView&Query=" + escape( str ) + "&start=1");

    } }

    function returnFalse(s){ //guess the field if not supplied s = (s == null) ? document.forms[0].Query : 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; }

    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; }

    Here the HTML Header "<script>var isDocBeingEdited = " + @If(@IsDocBeingEdited; "true"; "false") + ";</script>"

    The URL (not a fixed address)

    I keep getting the message "The page cannot be displayed"

    What am I doing wrong? Please help Thanks Lew

Your Comments