Question:

Html??? pleeeeeeeeeze?

by  |  earlier

0 LIKES UnLike

Does anyone know an html code for a memo box for my site??? Best Answer (10 Points) Goes to first and best working answer!

 Tags:

   Report

1 ANSWERS


  1. is this it?:

    <!-- Paste this code into an external JavaScript file named: memoPad.js  -->

    /* This script and many more are available free online at

    The JavaScript Source :: http://javascript.internet.com

    Created by: Apache Jeff :: http://www.huntingground.freeserve.co.uk */

    cookieName="usermemo"

    expDays=365

    maxLength=4000 // 4078 cookie max

    document.onkeyup=chkLength

    ns=document.getElementById&&!document....

    firstRun=1

    //Memobox script

    function initMemo(){

    // enter the default text

    document.getElementById("intro").inner... ="This is your introductory text. Click anywhere to start.</div>"

    getMemo()

    displayLength=document.f1.the_pad.valu...

    }

    // ********** recieve (and reformat) the cookie data **********

    function getMemo(){ // added function

    inf=getCookie(cookieName) // get the saved memo

    if(!inf){return}

    document.f1.the_pad.value=inf // string from cookie

    if(document.f1.the_pad.value.length>0)... // if memo exists

    clrIntroLyr() // clear default text

    }

    chkLength()

    }

    function chkLength(e){

    if(firstRun!=1){ // if there is info in memo-pad Moz shows incorrect count when first run due to Moz generated error message

    keyChk=(!moz)?event.keyCode:e.which

    firstRun=0 // firstRun prevents that error message

    }

    document.getElementById("remainder").s...

    document.getElementById("remainder").s...

    document.getElementById("remainder").i...

    if(maxLength-escape(document.f1.the_pa...

    document.getElementById("remainder").s...

    if(maxLength-escape(document.f1.the_pa...

    document.getElementById("remainder").s...

    document.getElementById("remainder").s...

    }

    }

    if(escape(document.f1.the_pad.value).l...

    alert("Your memo is over the "+maxLength+" characters allowed\nby the cookie command.\nThis may result in your memo not being saved.\n\nPlease reduce the size of your memo\n\nThank You")

    }

    }

    function clrIntroLyr(){ // clear default text

    document.getElementById("intro").style... -500

    document.f1.the_pad.focus()

    chkLength()

    }

    function deleteMemo(){

    deleteCookie(cookieName)

    document.f1.the_pad.value=""

    document.getElementById("intro").style...

    document.getElementById("remainder").i...

    }

    function emailMemo() {

    input=document.f1.the_pad.value

    var output = ""

    for (var i = 0; i < input.length; i++) {

    if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)){

    i++;

    output += "%0D%0A"

    } else {

    output += input.charAt(i)

    }

    }

    location="mailto:yourname@youraddress....

    }

    function printMemo(){

    padTxt=document["f1"]["the_pad"].value

    output = ""

    for (var i = 0; i < padTxt.length; i++) {

    if(!moz){

    if (padTxt.charCodeAt(i) == 13 && padTxt.charCodeAt(i + 1) == 10){output += "<BR>"}

    else{output += padTxt.charAt(i)}

    }

    if(moz){

    if (padTxt.charCodeAt(i) == 10){output += "<BR>"}

    else{output += padTxt.charAt(i)}

    }

    }

    printWin=window.open('','printwin','le...

    printWin.document.write("<HTML>\n<HEAD...

    printWin.document.write("<TITLE>Print Page</TITLE>\n")

    printWin.document.write("<script>\n")

    printWin.document.write("<!--\n")

    printWin.document.write("function chkstate(){\n")

    printWin.document.write("if (document.readyState==\"complete\"){\n")

    printWin.document.write("window.close(...

    printWin.document.write("}\n")

    printWin.document.write("else{\n")

    printWin.document.write("setTimeout(\"...

    printWin.document.write("}\n")

    printWin.document.write("}\n")

    printWin.document.write("function printWin(){\n")

    printWin.document.write("window.print(...

    printWin.document.write("chkstate();\n...

    printWin.document.write("}\n")

    printWin.document.write("//-->\n")

    printWin.document.write("<\/script>\n"...

    printWin.document.write("</HEAD>\n")

    printWin.document.write("<BODY onload=\"printWin()\">\n")

    printWin.document.write(output)

    printWin.document.write("</BODY>\n")

    printWin.document.write("</HTML>\n")

    printWin.document.close()

    }

    // ********** Pass the data to the cookie **********

    function saveMemo(){ // added function

    var expdate = new Date ();

    expdate.setTime (expdate.getTime() + (expDays*24*60*60*1000)) // expiry date

    path=null  // path="/" = top directory, path=null this documents root directory

    data=document.f1.the_pad.value // string going to cookie

    if(data.length==0){return} // if no data do not save

    setCookie(cookieName,data,expdate,path... // this cookie is using dir root path

    }

    // Cookie functions

    // An adaptation of Dorcht's function for getting a cookie.

    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 getCookieVal(num) {

    var endstr = document.cookie.indexOf (";", num)

    if (endstr == -1)

    endstr = document.cookie.length

    return unescape(document.cookie.substring(num, endstr))

    }

    // An adaptation of Dorcht's function for setting a cookie.

    function setCookie(name, value, expires, path, domain, secure) {

    if (!expires){expires = new Date()}

    document.cookie = name + "=" + escape(value) +

    ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +

    ((path == null) ? "" : "; path=" + path) +

    ((domain == null) ? "" : "; domain=" + domain) +

    ((secure == null) ? "" : "; secure")

    }

    // An adaptation of Dorcht's function for deleting a cookie.

    function deleteCookie(name,path,domain) { // deletes cookie

    document.cookie = name + "=" +

    ((path == null) ? "" : "; path=" + path) +

    ((domain == null) ? "" : "; domain=" + domain) +

    "; expires=Thu, 01-Jan-00 00:00:01 GMT"

    }

    // hide or show CONFIRM div

    function showHide(layerid){

    if (document.getElementById(layerid).style.... != "hidden"){

    document.getElementById(layerid).style... = "hidden"

    }else{

    document.getElementById(layerid).style... = "visible"

    }

    }

    window.onload=initMemo;

    window.onunload=saveMemo;

    <!-- Paste this code into an external HTML file named: memo_pop.htm  -->

    /* This script and many more are available free online at

    The JavaScript Source :: http://javascript.internet.com

    Created by: Apache Jeff :: http://www.huntingground.freeserve.co.uk */

    <HTML>

    <HEAD>

    <TITLE>Memo Pad</TITLE>

    <script type="text/javascript" src="memoPad.js"></script>

    </HEAD>

    <BODY><!-- INTRO -->

    <div id="intro" style="padding-right:13px; padding-left:13px; z-index:2; left:0px; padding-bottom:13px; overflow:auto; width:344px; cursor:pointer; padding-top:5px; position:absolute; top:27px; height:213px" onclick="clrIntroLyr()"></div>

    <!-- MEMO-PAD -->

    <FORM name=f1>

    <div id=head_table style="background:#00009C; left:0px; width:350px; position:absolute; top:0px; height:240px; text-align:center">

    <TABLE border=0 style="font-size:12px; width:100%; color:#ffffff; text-align:left">

    <TBODY>

    <TR>

    <TD width=110>JavaScript Source</TD>

    <TD>Memo Box</TD>

    <TD>

    <div id=remainder>0000</div></TD>

    <TD align=middle><A href="#null" style="color:#ffffff;" onclick="showHide('conFirm')" title="Delete the cookie and memo Contents">Delete</A></TD>

    <TD align=middle><A href="#null" style="color:#ffffff;" onclick="emailMemo()" title="E-mail the memo contents">E-Mail</A></TD>

    <td align="center"><a href="#null" style="color:#ffffff;" onclick="printMemo()" title="Print the memo contents">Print</A></td>

    <TD align=middle><A href="#null" style="color:#ffffff;" onclick="self.close()" title="Save and & close Memo-Pad">Save</A></TD>

    </TR>

    </TBODY>

    </TABLE>

    <TEXTAREA id=the_pad style="border-right:#908460 4px ridge; border-top:#908460 4px ridge; font-size:12px; overflow:auto; border-left:#908460 4px ridge; width:346px; color:#6b3908; line-height:15px; border-bottom:#908460 4px ridge; height:220px; background-color:#ffffff; text-align:left" rows=1></TEXTAREA>

    </div>

    </FORM>

    <!-- CONFIRM div -->

    <div id=conFirm style="border-right:#808080 2px solid; border-top:#ffffff 2px solid; font-weight:bold; z-index:5; background:#c9bda9; left:50px; VISIBILITY:hidden; border-left:#ffffff 2px solid; width:250px; color:#ffffff; border-bottom:#808080 2px solid; position:absolute; top:65px">

    <div style="filter:progid:DXImageTransform.Mi... EndColorStr='#FFc9bda9'); height:20px"> JavaScript Source</div>

    <P>

    <p style="text-align: center;">

    <font color="black" size="2">Are you sure you want to delete your memo?</font>

    </p>

    <FORM>

    <span style="border-right:#000000 1px groove; border-top:#000000 1px groove; left:50px; border-left:#000000 1px groove; width:75px; border-bottom:#000000 1px groove; position:relative; top:10px; height:22px"><INPUT style="border-right:#ffffff 1px outset; border-top:#ffffff 1px outset; font-size:10px; border-left:#ffffff 1px outset; width:74px; border-bottom:#ffffff 1px outset; height:20px" onclick="deleteMemo();showHide('conFirm'... type=button value=Yes>

    </span>

    <span style="border-right:#000000 1px groove; border-top:#000000 1px groove; left:65px; border-left:#000000 1px groove; width:75px; border-bottom:#000000 1px groove; position:relative; top:10px; height:22px"><INPUT style="border-right:#ffffff 1px outset; border-top:#ffffff 1px outset; font-size:10px; border-left:#ffffff 1px outset; width:74px; border-bottom:#ffffff 1px outset; height:20px" onclick="showHide('conFirm')" type=button value=No>

    </span>

    </FORM>

    </div>

    </BODY>

    </HTML>

    <!-- Paste this code into the BODY section of your HTML document  -->

    <form style="text-align: center;">

    <input type="button" onclick="my_pad=window.open('memo_pop.ht... value="Open Memo Pad">

    </form>

    someone please answer my question?:

    http://answers.yahoo.com/question/index;...

You're reading: Html??? pleeeeeeeeeze?

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions