Skripts:
Code
<center><script language="JavaScript">
<!--
function addCookie(szName,szValue,dtDaysExpires)
{
var dtExpires = new Date();
var dtExpiryDate = "";
dtExpires.setTime(dtExpires.getTime() + dtDaysExpires * 24 * 60 * 60 * 1000);
dtExpiryDate = dtExpires.toGMTString();
document.cookie = szName + "=" + escape(szValue) + "; expires=" + dtExpiryDate;
}
function findCookie(szName)
{
var i = 0;
var nStartPosition = 0;
var nEndPosition = 0;
var szCookieString = document.cookie;
var szTemp = "";
while (i <= szCookieString.length)
{
nStartPosition = i;
nEndPosition = nStartPosition + szName.length;
if(szCookieString.substring(nStartPosition,nEndPosition) == szName)
{
nStartPosition = nEndPosition + 1;
nEndPosition = document.cookie.indexOf(";",nStartPosition);
if(nEndPosition < nStartPosition)
nEndPosition = document.cookie.length;
szTemp = document.cookie.substring(nStartPosition,nEndPosition);
return unescape(szTemp);
break;
}
i++;
}
return "";
}
function removeCookie(szName)
{
var dtExpires = new Date();
dtExpires.setTime(dtExpires.getTime() - 1);
var szValue = findCookie(szName);
document.cookie = szName + "=" + szValue +
"; expires=" + dtExpires.toGMTString();
}
function btnClick()
{
addCookie("MyText",TestForm.Comment.value,10);
}
// -->
</SCRIPT>
</head>
<BODY BGCOLOR=white>
<FORM NAME="TestForm">
<P><TEXTAREA NAME="Comment" input class="input_zametka" onFocus="if(this.value=='Izmainīt piezīmi') this.value='';" onBlur="if(!this.value) this.value='Izmainīt piezīmi';" style="overflow:hidden" ROWS="15" COLS="34">
Izmainīt piezīmi</TEXTAREA>
<P><INPUT TYPE="button" VALUE="Saglabāt piezīmi"
onClick="btnClick();">
<INPUT TYPE="button" VALUE="Dzēst piezīmi"
onClick="removeCookie('MyText');TestForm.Comment.value=''">
<SCRIPT LANGUAGE="JavaScript">
<!--
var szMyText="";
szMyText = findCookie("MyText");
if(szMyText != "")
{
TestForm.Comment.value = szMyText;
}
// -->
</SCRIPT>
</div>
</div></center>
@ Customize design - Style sheet (CSS):
Code
.input_zametka {
background: url('http://ucozwebmeistars.ucoz.lv/Pamacibas2/24b47c451dbb.png') no-repeat center #f9f9f9;font:12px Verdana,Comic Sans MS,Helvetica,sans-serif;
color:#808080; font-weight: bold;
}
input, textarea {outline:none;} /* uCozwebmeistars */
textarea {
resize: none;
}
.property_zametka {
padding: 2px;
}
.input_zametka {
padding: 40 10 10 40px;
}
.input_zametka {
border:0px solid #999;
}
.input_zametka {
overflow: auto;
}
Iznākums: