Code Carnet d'Adresse HoSaM 8:57 AM Code Carnet d'Adresse <br /> <!-- DEUX ETAPES D'INSTALLER LE Carnet d'Adresse: 1. PLACEZ LE CODE 1 ENTRE LES BALISES HEAD DU DOCUMENT HTML 2. METTEZ LE CODE 2 ENTRE LES BALISES BODY DU DOCUMENT HTML --><br /> <br /> <!-- ETAPE 1: INSEREZ LE CODE 1 CI DESSOUS ENTRE LES BALISES <HEAD>...</HEAD> DU HTML --><br /> <br /> <HEAD><br /> <br /> <SCRIPT LANGUAGE="JavaScript"> <!-- Ce code et d'autre sont sur le site GRATUIT --> <!-- Le code java !!!! http://www.lecodejava.com --> <!-- Begin var arrRecords = new Array(); var arrCookie = new Array(); var recCount = 0; var strRecord=""; expireDate = new Date; expireDate.setDate(expireDate.getDate()+365); function cookieVal(cookieName) { thisCookie = document.cookie.split("; ") for (i = 0; i < thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } function loadCookie() { if(document.cookie != "") { arrRecords = cookieVal("Records").split(","); currentRecord(); } } function setRec() { strRecord = ""; for(i = 0; i < document.frm1.elements.length; i++) { strRecord = strRecord + document.frm1.elements[i].value + ":"; } arrRecords[recCount] = strRecord; document.frm2.add.value = " NEW "; document.cookie = "Records="+arrRecords+";expires=" + expireDate.toGMTString(); } function newRec() { switch (document.frm2.add.value) { case " NEW " : varTemp = recCount; for(i = 0; i < document.frm1.elements.length; i++) { document.frm1.elements[i].value = "" } recCount = arrRecords.length; document.frm2.add.value = "CANCEL"; break; case "CANCEL" : recCount = varTemp; document.frm2.add.value = " NEW "; currentRecord(); break; } } function countRecords() { document.frm2.actual.value = "Record " + (recCount+1)+"; "+arrRecords.length+" saved records"; } function delRec() { arrRecords.splice(recCount,1); navigate("previous"); setRec(); } function currentRecord() { if (arrRecords.length != "") { strRecord = arrRecords[recCount]; currRecord = strRecord.split(":"); for(i = 0; i < document.frm1.elements.length; i++) { document.frm1.elements[i].value = currRecord[i]; } } } function navigate(control) { switch (control) { case "first" : recCount = 0; currentRecord(); document.frm2.add.value = " NEW "; break; case "last" : recCount = arrRecords.length - 1; currentRecord(); document.frm2.add.value = " NEW "; break; case "next" : if (recCount < arrRecords.length - 1) { recCount = recCount + 1; currentRecord(); document.frm2.add.value = " NEW "; } break; case "previous" : if (recCount > 0) { recCount = recCount - 1; currentRecord(); } document.frm2.add.value = " NEW "; break; default: } } // if (!Array.prototype.splice) { function array_splice(ind,cnt) { if (arguments.length == 0) return ind; if (typeof ind != "number") ind = 0; if (ind < 0) ind = Math.max(0,this.length + ind); if (ind > this.length) { if (arguments.length > 2) ind = this.length; else return []; } if (arguments.length < 2) cnt = this.length-ind; cnt = (typeof cnt == "number") ? Math.max(0,cnt) : 0; removeArray = this.slice(ind,ind+cnt); endArray = this.slice(ind+cnt); this.length = ind; for (var i = 2; i < arguments.length; i++) { this[this.length] = arguments[i]; } for(var i = 0; i < endArray.length; i++) { this[this.length] = endArray[i]; } return removeArray; } Array.prototype.splice = array_splice; } recCount = 0; loadCookie(); countRecords(); // End --> </script><br /> </HEAD><br /> <br /> <!-- ETAPE 2: INSEREZ LE CODE 2 CI DESSOUS ENTRE LES BALISES <BODY>...</BODY> DU DOCUMENT HTML --><br /> <br /> <BODY><br /> <br /> <center><br /> <form name="frm1"><table align="center" resize="none" border="0"><tr> <td align="right">Nom:</td> <td colspan="5"><input type="box" name="name" size="49"></td> </tr> <tr> <td align="right">Addresse 1:</td><td colspan="5"><input type="box" name="address" size="49"></td></tr> <td align="right">Addresse 2:</td><td colspan="5" align="left"><input type="box" name="address2" size="49"></td></tr> <tr> <td align="right">Ville:</td> <td><input type="box" name="city" size="15"></td> <td>Etat:</td><td><input type="box" name="state" size="15"></td> <td>Code:</td><td><input type="box" size="6" name="zip"></td> </tr> <td align="right">Telephone:</td> <td align="left"><input type="box" name="phone" size="15"></td> <td align="right">Fax:</td><td align="left"><input type="box" name="fax" size="15"></td> </tr> <tr> <td align="right">Page Web:<td colspan="5" align="left"><input type="box" name="address" size="49"></td></tr><br /> <td align="right">E-Mail:<td colspan="5" align="left"><input type="box" name="email" size="49"></td></tr><br /> <tr><td align="right" valign="top">Comments:</td><br /> <td colspan="5" align="left"><input type="box" name="comment1" size="49"><br><br /> <input type="box" name="comment2" size="49"><br><br /> <input type="box" name="comment3" size="49"><br><br /> <input type="box" name="comment4" size="49"><br><br /> <input type="box" name="comment5" size="49"><br /> </td></tr></table></form><form name="frm2"><table align="center" border="1" resize="none"><tr><td align="center"><br /> <input type="button" name="first" value="|<< " onClick="navigate('first');countRecords()"><br /> <input type="button" name="previous" value=" < " onClick="navigate('previous');countRecords()"><br /> <input type="button" name="next" value=" > " onClick="navigate('next');countRecords()"><br /> <input type="button" name="last" value=" >>|" onClick="navigate('last');countRecords()"><br /> <input type="box" name="actual" size=30></td></tr> <tr><td align="center"><input type="button" name="add" value=" nouveau " onClick="newRec();countRecords()"><br /> <input type="button" name="set" value="Enregistrer" onClick="setRec();countRecords()"><br /> <input type="button" name="del" value="Effacer" onClick="delRec();countRecords()"></td></tr></table></form></center><br /> <br /> <br /> <br /> <!-- Script Size: 6.00 KB --> ÔÇÑß ÇáãæÖæÚ: Codes Related Posts