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

  1. noapi1
    Posted 1 year 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.


  2. Takayuki Miyoshi
    Plugin Author

    Posted 1 year 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic