function onQueryExecute()
{
// This array should contain all the names of the boxes
// on your screen. All names should be enclosed in quotes
// and separated by a comma. Any boxes that are not named
// in the box array will not have a replacement made.
var boxArray = new Array ("searchBox","nameBox","companyBox","directionsBox");
contentReplace(boxArray,"AND","&");
contentReplace(boxArray,"OR","/");
contentReplace(boxArray,"NOT","!");
}
function contentReplace(boxNameArray, oldText, newText)
{
var boxContents;
var newContents;
var regText = new RegExp(oldText, "g");
for(i=0;i < boxNameArray.length;i++)
{
boxContents = Form.boxes(boxNameArray[i]).content;
newContents = boxContents.replace(regText,newText);
Form.boxes(boxNameArray[i]).content = newContents;
}
} |