hi I use watermark for textbox in page and I define fontsize for watermark
below are code:
<script type="text/javascript">
window.onload = function SetColorOnPageLoad() {
var defalutAzText = "از";
var defalutTaText = "تا";
var defalutsearch = "جستجو بر اساس کد ملک";
functionSetColor(document.getElementById("Txtsearch"), defalutsearch);
functionSetColor(document.getElementById("Txtejare1"), defalutAzText);
functionSetColor(document.getElementById("Txtejare2"), defalutTaText);
functionSetColor(document.getElementById("txtvadi1"), defalutAzText);
functionSetColor(document.getElementById("txtvadi2"), defalutTaText);
}
function functionSetColor(Textbox, WaterMark) {
if (Textbox.value.length > 0 && Textbox.value == WaterMark) {
Textbox.style.color = "#443f13";
txt.style.fontSize = "14.5px";
} else {
Textbox.style.color = "white";
txt.style.fontSize = "14.5px";
}
}
function WaterMark(txt, evt, msg) {
if (txt.value.length == 0 && evt.type == "blur") {
debugger;
txt.style.color = "#443f13";
txt.value = msg;
txt.style.fontSize = "14.5px";
txt.style.fontfamily = "behtop_Yekan";
}
if (txt.value == msg && evt.type == "focus") {
txt.style.color = "white";
txt.value = "";
txt.style.fontSize = "14.5px";
txt.style.fontfamily = "behtop_Yekan";
}
}
</script>
problem is that here at first when run page it shows watermark with size that I define for textbox (in css) and when I click on textbox and after that click out of text box it will display watermark's fontsize that I define an above code
please refer below video:
https://vimeo.com//220612125
best regards
neda