Forums

Styling disappears on input boxes with validation

Further 23 Jul, 2008
I have built a form that has a style on the input boxes with a background color. For example the form text box where a person puts in their email address is not white but has a brown background. The issue is when I turn validation on all of the fields that I validate loose their styling and simply have a white background again.

Any ideas why that is happening and how I can get those boxes to hold their style?

Thanks
GreyHead 23 Jul, 2008
Hi Alex,

Validation use the class attribute of the input tags. If you add a second class attribute the two interfere.

There are three answers to this:

1) set you class attributes to include 'required', etc and don't put the field names in the Validation tab (just turn validation on and select the library)

2) use different selectors for your css e.g. form.input

3) wait for the next release of ChronoForms where Max says that he's fixed this.

Bob
Further 27 Jul, 2008
Thanks. Apparently I am not following you on how to do this though.

How do I set class attributes to include 'required'? I am putting the css directly in the form for chronoforms and not using it as the form style for the whole site. I unfortunately can't wait till the next release since my clients site goes live this week. Thanks --- Alex
GreyHead 28 Jul, 2008
Hi Further,

Just add the extra class inside the class attribute like
class="input_box required"

Then, on the Validation tab turn validation on but do not enter any field names.

Bob
Further 28 Jul, 2008
Ok. That's an easy fix. Is there a way for you to validate email though so that they have to put in an email address and not just validation fo it being left blank?
GreyHead 28 Jul, 2008
Hi further,
class="required validate-email input_box"

Bob
Further 28 Jul, 2008
Thanks. That's great. This will hold me over until the next release.
This topic is locked and no more replies can be posted.