Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 762825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:27:28+00:00 2026-05-14T16:27:28+00:00

When a drupal form fails validation, it is redrawn with the elements that failed

  • 0

When a drupal form fails validation, it is redrawn with the elements that failed validation surrounded in a red border. Drupal does this by adding the error class to the input elements, and specifing a 2px red border on input.error elements in system.css.

Without modifying this stylesheet, how can I remove the red border on a specific form only, while using the default behavior on the rest of the site?

I believe the solution might require using a custom theme_form_element, but I can’t figure out how to customize a single form only.

Note that I would like to do this without having to resort to this jQuery trick (which does work):

$("#edit-name").removeClass('error');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T16:27:29+00:00Added an answer on May 14, 2026 at 4:27 pm

    You will need to remove the error class from the form items. This can be done by overwriting the theme functions, in theme_textfield, theme_textarea … (there is one for each type)

    Take a look at $element['#attributes']['class'] which contains the error class.

    EDIT
    To do it for a specific form element or form you can use the #theme attribute or either form or element you want to change the theming function for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All I need to do is have a form that does this: User enters
I have a Drupal form array that uses a prefix of '#' to indicate
Is there a better way to find all form elements in a Drupal form
I need to ensure that the user login form for Drupal can not be
I would like to create a data entry form in Drupal 7 that is
I'm creating a Drupal form with a datetime-based javascript popup calendar input that allows
I am writing a drupal module that involves a form with many checkboxes. E.g.
I am adding a comment form to a view, in fact, in this view
I'd like to print Drupal's advanced node search form (the one that appears on
I have a Drupal form and a submit function that processes that form. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.