Hi,
I'm trying to change the border colour of any text input form field that has a length of more than zero. So far I've been trying this but it doesn't work...
I don't know if it's a syntax thing, or if I'm just plain doing it wrong.Code:<script type="text/javascript"> var notempty = document.getElementsByTagName(input).value; if (notempty.value.length > 0) { document.getElementsByTagName(input).style.borderColor="red"; } else { document.getElementsByTagName(input).style.borderColor="transparent"; } </script>
I'm trying to actually learn and understand Javascript so if you could help me to adapt this code rather than giving me a more efficient way of doing this then that'd be great.
cheers guys


Reply With Quote

Bookmarks