#fcleft">



Type your name in the box:
(This form only works on browsers that have Javascript)


This is a better piece of Javascript to use than the ask for name. Not only is it less irritating, but it also saves the person's name (hence "Javascript Storing A Name"). I would definitely put this in if your page is starting to get more popular.
The source...


<script language="JavaScript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.geocities.com/ResearchTriangle/1500

    function getCookieVal (offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    }

    function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
    }
    return null;
    }

    function SetCookie (name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
    }

    function DeleteCookie(name) {
    var exp = new Date();
    FixCookieDate (exp); 
    exp.setTime (exp.getTime() - 1); 
    var cval = GetCookie (name);
    if (cval != null)
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
    }

    function addCookie(form) {
    if (form.Name.value!="") {
    var thenewdate = new Date ();
    thenewdate.setTime(thenewdate.getTime() + (365 * 24 * 3600 * 1000));
    SetCookie('yourname',form.Name.value,thenewdate); }
    }

    var yourname = GetCookie('yourname');
//-->
</script>

<form name=mine>
<center>Type your name in the box: 
<input type=text name=Name size=20 onBlur="addCookie(this.form);">
<br>
<font size=-2>(This form only works on browsers that have Javascript)</font>
</form>
<script language="Javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.geocities.com/ResearchTriangle/1500

if (yourname == null) {
document.write("Please enter in your name.");
}

else {
document.write("Your current handel is<b>: "+GetCookie('yourname')+"</b>");
}

//-->

</script>


Main Page