Manage Learn to apply best practices and optimize your operations.

Set And Read A Cookie From A Notes Form.

This javascript when used in a notes form will both set and read a cookie on
the users browser.
For each field you are using in your cookie in the "onBlur" event, you must


This Goes in the "JSHeader" in R5 or the header of the form
<!-- hide from older browsers
function setCookie()
expireDate = new Date();
y1 = expireDate.getYear();
if (y1 < 100)
y1 = y1 + 1900;
expireDate.setYear(y1 + 1);
e1 = ";expires=" + expireDate.toGMTString() + ";path=";
document.cookie = "PostedBy=" + document.forms[0].PostedBy.value + e1;
document.cookie = "eMailAddress=" + document.forms[0].eMailAddress.value + e1;
document.cookie = "ImageURL=" + document.forms[0].ImageURL.value + e1;
// end hide -->

This Goes at the very bottom of the form form
if ((document.cookie != "") && (document.forms[0].PostedBy))
c1 = document.cookie.split(";");
if (c1[0] != "")
document.forms[0].PostedBy.value = c1[0].split("=") [1]
if (c1[1] != "")
document.forms[0].eMailAddress.value = c1[1].split("=") [1]
if (c1[2] != "")
document.forms[0].ImageURL.value = c1[2].split("=") [1]
if (c1[3] != "")
document.forms[0].UserHostName.value = c1[3].split("=") [1]
This was last published in November 2000

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.




  • iSeries tutorials'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 ...