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
<SCRIPT>
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>
This was first published in November 2000

Dig deeper on Domino Resources - Part 4

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

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 ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close