1

I am making a shopping store site with D7 and Drupal Commerce.

In the checkout pane page, there are several form fields for information of customers such as name, address, phone, and so on, have set up with default email-form and other forms with a contributed module "Customer Profile Type UI".

However, when the forms are not filled with correctly, those only show a module-generated error message for all incorrectly-filled forms altogether, but don't show red-bordered error indication for each form by generating error-css-CLASS or ID.

Is there any way to add the <a style="color:red;">red-bordered error indication</a> in the pane page by a module? Or adding some PHP code? If the latter, could someone teach me what code to add, to which file (.module .tpl .info .api etc...) to add it?

I'm not used to PHP-coding, but might work out with a clear guidance.

Any practical answer will be appreciated.

  • Do you by any chance use panels or panelizer for your display of the product? – dmsmidt Jul 6 '16 at 8:00
0

I think the issue you are facing can be solved by setting the css as

.form-item input.error {
    border: 2px solid red;
}

Hope it will work for you!

  • Thank you for your comment. But although having added your CSS-code, it doesn't effect, probably the forms originally have no [.form-item input.error] classes. Besides the CSS-code is already in my system for a module "webform". the forms seem only have ID&class below: <input class="text-full form-text required" type="text" id="edit-customer-profile-billing-field-name-und-0-value" name="customer_profile_billing[field_name][und][0][value]" value="" size="60" maxlength="255"> – takao Sep 30 '14 at 10:05
  • Im thinking to edit html(php)code in some file to add dynamical css code [input required] etc,,, but don't know which one to do it,,, – takao Sep 30 '14 at 10:14
  • Ok No problem. when error seems to be occured. You may find the error class appeared to be there. Use that class accordingly. – TBI Infotech Oct 1 '14 at 6:36
  • Hi, It actually was what I thought to do in the beginning too that using the 【error class】would be appeared with errors. But the point is that the 【error class】itself is missing and hasn't been set up in the system. – takao Oct 3 '14 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.