Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2008
    Posts
    54
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Question javascript form field validation change color back when

    I need to get the invalid fields to change back to blue when they're validated upon submit or even clicking out of the field.
    I'm not good in writing javascript yet so please include all of the javascript and html with the edits highlighted in the code:

    The page:
    http://shoppingcartcash.com

    The js:
    http://shoppingcartcash.com/form.js

    Thanks!

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Try to add highlighted:
    Code:
    function CheckTheForm() {
        var result = true;
        var msg="";
    	
    	for(var i=0;i<=12;i++)
    		document.getElementById('FieldData'+i).style.color='#000066';
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •