Manage Learn to apply best practices and optimize your operations.

Automatic Keyword Launch 2

On a Lotus Notes Web page, I have keyword fields. My goal was to let the user select an option of any one of the keyword fields and once selected take them to a URL based on that selection.

The problem was to get JavaScript to see the Notes field then react as I wanted it to.

Below is the solution that I came up with...

The difference between the last code that I submitted is that the keyword fields are hardcoded but the URLs are different. Simple nested if logic is sloppy and would not work right, so here is what I used.


Put the following JavaScript function on the JSHeader section of the form:
function GoSiteJump() {
var f=document.forms[0]
current = f.SiteJump.selectedIndex;
currenttext = f.SiteJump.options[current].text;

switch(currenttext){
case "OKI Home" :
window.open("http://www.okidata.com" , "_top")
return
break
case "Support Home" :
window.open"http://my.okidata.com", "_top")
return
break
case "Products" :
window.open("http://www.okidata.com/mkt/html/nf/Products.html", "_top")
return
break
case "About Us" :
window.open("http://www.okidata.com/mkt/html/nf/AboutUs.html", "_top")
return
break
case "Whats New" :
window.open("http://www.okidata.com/mkt/html/nf/WhatsNew.html", "_top")
return
break
case "Buy On-Line" :
window.open("http://esales.okidata.com", "_top")
return
break
case "Dealer Locator" :
window.open("http://www.okidata.com/mkt/html/nf/DealerLocator.html",
"_top")
return
break
default:
alert("Please Select a Location ")
return
break
}}

On each field make a call to a function in the JSHeader section of the form from the onChange event of said field. Example:
GoSiteJump

Note:
1)"SiteJump" is the field name

2)You will need one function for every keyword field that you have

3)Make sure that both of the refresh options of the field are NOT checked

4)Make sure that the "Automaticly Refresh Fields" option IS checked on the form.

Dig Deeper on Domino Resources - Part 2

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close