Tipiford Posted June 10, 2012 Share Posted June 10, 2012 Hope I'm in the right forum, I'm having issues with a captcha error printing its message in color.I have tried too many lines of code in php, xhtml and css and this code within javascript was my final attempt; document.write(frmvalidator.addValidation("name","req","Enter your name").fontcolor("red")); but nothing I've tried will change the message color. Please tell me what I have wrong (or point me in the right direction). Link to comment Share on other sites More sharing options...
Ingolme Posted June 10, 2012 Share Posted June 10, 2012 This doesn't make much sense to me. To change the font color of an element, you first must access the element. For example, with document.getElementById(). Then you set the CSS like this:document.getElementById("elementID").style.color = "red"; Link to comment Share on other sites More sharing options...
eTianbun Posted June 10, 2012 Share Posted June 10, 2012 Does addValidation() returns a string? Just asking, coz i dont realy understand what you have there! Link to comment Share on other sites More sharing options...
Tipiford Posted June 11, 2012 Author Share Posted June 11, 2012 Any changes in the css file have produced no changes in the php file, so the above code I placed in the php file. (The css file came with the captcha javascript that I've modified, so it's not like I've written any errors into it, just changed the file names--but maybe so.)The addValidation() is the returned string of the error (of not entering a name in the form). The php file and its corresponding css file came from www.html-form-guide.com's 'contact form with captcha'. Link to comment Share on other sites More sharing options...
Tipiford Posted June 11, 2012 Author Share Posted June 11, 2012 All resolved and thanx for the responses. The issue (as is usually the case) was my nimble fingers weren't quite so nimble--maybe a little too fat; so incorrectly modifying the code was at the base of the issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now