•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,901 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,596 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 12239 | Replies: 2
![]() |
| |
•
•
Join Date: Jan 2005
Location: defiance, oh
Posts: 19
Reputation:
Rep Power: 4
Solved Threads: 1
I tried several things. i get invalid char or no object. can one change fore color or setup a mask. the text box contains numbers and if the number is negitive i need it to show in red, black if not.
var oRed = '#ff0000'
var oBlack = '#000000'
if (parseInt(document.getElementById('nm1TextBox').value) < parseInt(0))
{document.getElementById('nm1TextBox').forecolor = oRed;}
else
{document.getElementById('nm1TextBox').forecolor = oBlack;}
var oRed = '#ff0000'
var oBlack = '#000000'
if (parseInt(document.getElementById('nm1TextBox').value) < parseInt(0))
{document.getElementById('nm1TextBox').forecolor = oRed;}
else
{document.getElementById('nm1TextBox').forecolor = oBlack;}
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- Change text color using visual c++ (C++)
- change the font/color of the selected text on a web page through javascript (JavaScript / DHTML / AJAX)
- Change left-border of a table cell with javascript (JavaScript / DHTML / AJAX)
- How Vb.NET Textbox background color change when TabStop come? (VB.NET)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Random CSS
- Next Thread: Help w (document.lastModified)



Hybrid Mode