Results 1 to 2 of 2

Thread: How to colour fields if there is error? Simple question

  1. #1
    Join Date
    Jan 2006
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to colour fields if there is error? Simple question

    Hello,
    I have problem how to do correct code with PHP:
    1.colour text and input box if there is an error in form.

    Need help.

    I have the following code but it is wrong:
    PHP Code:
     <?PHP (isset($error)) ? 'class=headingERROR' 'class=headingCORRECT' ;?>
    <input name="firstname" class="box" maxlength="30" size="20">
    Regards

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    if you want to do them 1 line at a time, then I suggest you use javascript and the onchange method to validate what has been entered. However if you choose to go with php, then the fix isn't as simple. If no one has answered you by 5pm EST I will give you a solution that I came up with, as I am presently at work.

Bookmarks

Posting Permissions

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