SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast konsama's Avatar
    Join Date
    Jun 2007
    Location
    Sweden
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I make my popup Errors in QF be red like this instead?

    How do I make my popup Errors in QF be printed in red like this instead?

    Quickform:


    Code:
        // The field for confirming the password
        $form->addElement('password','confirmPass','Confirm:','class="signupData"');
        $form->addRule('confirmPass','Please confirm password','required',false,'client');
        $form->addRule('confirmPass','Passwords must match','compare','function');
    
        // The email field
        $form->addElement('text','email','Email Address:','class="signupData"');
        $form->addRule('email','Please an email address','required',false,'client');
        $form->addRule('email','Please enter a valid email address','email',false,'client');
        $form->addRule('email','Email cannot be more than 50 characters','maxlength',50,'client');
    The only clue I got from my 6.php file where the $form->add* code was along with the CSS code. Was this CSS code:
    Code:
    .error { color: red; }
    But I don't see how the .error is connected to the 'Passwords must match' code?
    Code:
        $form->addRule('confirmPass','Passwords must match','compare','function');

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have never really used QuickForm before but I can only assume that while QF is generating the view portion of your form, errors are wrapped in <span class='error'></span> tags, which is why it obeys that CSS rule.

    I'm sure QF has an option somewhere to set which CSS class errors inherit.
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer


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
  •