Help Desk

Error class for required fields

  • Posts: 1 Topics: 1
    | Permalink

    I am using my own edit-events.php file just to modify the layout of the submission page. However, the error classes do not work if I use my own label fields (or without any). Can you please advise how to have the required fields receive an error class upon validation?

    Posts: 2356
    | Permalink

    Hi Anna!

    The validation script is tied to the information in the fields, so modifying them may prevent the script from working, and would require custom js to re-implement. This level of customization is unfortunately a bit outside of our Scope of Support.

    You can read more about customizing the Event templates on our Themer’s Guide.

    Is it possible for you to modify the layout without changing the fields/labels? Maybe just focus on the container elements?

    Let me know if this helps.

    Thanks,
    Sky

    Posts: 1 Topics: 1
    | Permalink

    Thanks for the reply Sky.

    I’m trying to avoid clunky CSS to override existing styles of the plugin and use form styles already implemented in my form.

    Can you elaborate on what you mean by “tied to the information in the fields”? Maybe I can set up my new fields to have the same information. Ultimately all I need to do is remove labels, containers, and assign a few extra classes to the input fields themselves.

    Posts: 2356
    | Permalink

    Anna,

    To elaborate, I mean that there isn’t a generic class you can add to your own markup that will make any field you create just work. You will need to maintain the id, classes and other attributes for the javascript to keep working with those fields. You could probably add some CSS classes to the fields for custom styling purposes, but they will need the original data.

    The label and field markup is generated via a few php functions which have filters which may be used for customization. You could use these filters, or, you could copy the markup the php generates and add your own classes to that. Again, this type of customization is outside of our scope of support. If you are an experienced PHP developer, it is certainly possible to customize. Otherwise, dealing with some clunky CSS may be easier.

    Good luck! Let us know if you have any other questions.

    Thanks,
    Sky

    Posts: 65
    | Permalink

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

    | Permalink

The topic ‘Error class for required fields’ is closed to new replies.