K
Ken
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="JavaScript">
<!--
function spin(fillin,count)
{
var intVal;
setcolor(fillin,"#fff000"); // works fine
// but keep getting object expected error
setTimeOut('setcolor(' + fillin + ',"#000fff");',1000);
intVal = eval(fillin.value) + eval(count);
if (intVal < 0) intVal = 0;
if (intVal > 999) intVal = 1000;
fillin.value = intVal;
return 0;
}
<!--
function setcolor(fldname,clrcode)
{
fldname.style.color = 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('setcolor(' + fillin.name + ',"#000fff");',1000);
and tried getObjectByName - no good, at least
Document.getobjectbyname(flname).style.color was invalid...
set fstring = 'setcolor(' + fillin + ',"#000fff");' and called
setTimeOut(fstring,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="JavaScript">
<!--
function spin(fillin,count)
{
var intVal;
setcolor(fillin,"#fff000"); // works fine
// but keep getting object expected error
setTimeOut('setcolor(' + fillin + ',"#000fff");',1000);
intVal = eval(fillin.value) + eval(count);
if (intVal < 0) intVal = 0;
if (intVal > 999) intVal = 1000;
fillin.value = intVal;
return 0;
}
<!--
function setcolor(fldname,clrcode)
{
fldname.style.color = 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('setcolor(' + fillin.name + ',"#000fff");',1000);
and tried getObjectByName - no good, at least
Document.getobjectbyname(flname).style.color was invalid...
set fstring = 'setcolor(' + fillin + ',"#000fff");' and called
setTimeOut(fstring,1000) but this didn't cut either.
Any advice, redirection or other instructions will be appreciated.
Thanks
Ken