Hi
I have the following js function which is very nice as it both restricts the inputable length of the
input text box named x_desc_sht to the variable limit plus it displays the number of characters left.
It displays this in a textt box just below named desc_count
<!--
function chk_length(){
limit1= 10
document.main_fm.desc_count.value=(limit1-document.main_fm.x_desc_sht.value.length)+' characters free'
if(document.main_fm.x_desc_sht.value.length>limit1){
document.main_fm.x_desc_sht.value=document.main_fm.x_desc_sht.value.substring(0,limit1)
}
} // end of function
then I use this to display it:
<td class = 'add_col4' ><input type='TEXT' name='desc_count' size = '25' /></td>
This is nice but I don't like the style of using the input text box !
I thought of 3 alternatives but I don't know if they are possible
1)- can I write the
(limit1-document.main_fm.x_desc_sht.value.length)+' characters free' into a <TD> tag ?
as in :
var val1 = (limit1-document.main_fm.x_desc_sht.value.length)+' characters free'
<TD> <script> print val1 </script> </TD>
OR
2) can I name a <TD> tag as in <TD class = 'nice_style' name = 'desc_count' > ?
and then output with a nice style /
OR
3) Can I hide the borders on the text input box, change the font and colour and centre align it ?
( so it dosn't look like an input box)
Of course I want this to work in most browsers esp. IE and Moz/Nav.
Thanks for any help.
David.