WordPress.org

Forums

Contact Form 7
How to add a 'required' field with wpcf7_add_shortcode? (2 posts)

  1. noapi1
    Member
    Posted 11 months ago #

    Hi, I use "wpcf7_add_shortcode()" to add several additional fields to my form, but how can I make such a field, e.g. checkbox, a required field? I don't get this to work. Thanks.

    https://wordpress.org/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 11 months ago #

    wpcf7_add_shortcode doesn't control required/optional of a field. You need to add wpcf7_validate_{tag type} filter. Try searching wpcf7_text_validation_filter in contact-form-7/modules/text.php.

Reply

You must log in to post.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic