Hello
I am trying to change the color of a font in a text box.
I have been reading about and trying various examples found it this
group, but still can't get it right.
Here is where I am now:
<script language="JavaS cript">
<!--
function spin(fillin,cou nt)
{
var intVal;
setcolor(fillin ,"#fff000"); // works fine
// but keep getting object expected error
setTimeOut('set color(' + fillin + ',"#000fff");', 1000);
intVal = eval(fillin.val ue) + eval(count);
if (intVal < 0) intVal = 0;
if (intVal > 999) intVal = 1000;
fillin.value = intVal;
return 0;
}
<!--
function setcolor(fldnam e,clrcode)
{
fldname.style.c olor = clrcode;
return 0;
}
//-->
</script>
I've tried various methods to get around this, but I think I need to
be able to pass the object, not the name. Ideas tried:
called setTimeOut('set color(' + fillin.name + ',"#000fff");', 1000);
and tried getObjectByName - no good, at least
Document.getobj ectbyname(flnam e).style.color was invalid...
set fstring = 'setcolor(' + fillin + ',"#000fff"); ' and called
setTimeOut(fstr ing,1000) but this didn't cut either.
Any advice, redirection or other instructions will be appreciated.
Thanks
Ken
I am trying to change the color of a font in a text box.
I have been reading about and trying various examples found it this
group, but still can't get it right.
Here is where I am now:
<script language="JavaS cript">
<!--
function spin(fillin,cou nt)
{
var intVal;
setcolor(fillin ,"#fff000"); // works fine
// but keep getting object expected error
setTimeOut('set color(' + fillin + ',"#000fff");', 1000);
intVal = eval(fillin.val ue) + eval(count);
if (intVal < 0) intVal = 0;
if (intVal > 999) intVal = 1000;
fillin.value = intVal;
return 0;
}
<!--
function setcolor(fldnam e,clrcode)
{
fldname.style.c olor = clrcode;
return 0;
}
//-->
</script>
I've tried various methods to get around this, but I think I need to
be able to pass the object, not the name. Ideas tried:
called setTimeOut('set color(' + fillin.name + ',"#000fff");', 1000);
and tried getObjectByName - no good, at least
Document.getobj ectbyname(flnam e).style.color was invalid...
set fstring = 'setcolor(' + fillin + ',"#000fff"); ' and called
setTimeOut(fstr ing,1000) but this didn't cut either.
Any advice, redirection or other instructions will be appreciated.
Thanks
Ken
Comment