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
enter:

setCookie()

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
&LTSCRIPT>
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]
}
}
</SCRIPT>

Dig Deeper on Domino Resources - Part 4

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close