Support » Plugin: Contact Form 7 » Select made using Shortcode

  • Hi,
    I have made some selects on my page using shortcodes drawing data from the database and they work fine.

    The only problem I have is that even if I set them as requires the validation is not picking them up.

    I have added the same classes as the regular dropdowns but still no luck.

    For example the shortcode outputs:
    <select name=”io-country” class=”wpcf7-form-control wpcf7-select wpcf7-validates-as-required” aria-required=”true” aria-invalid=”false”>

    Could you point me in the right direction with this please?

    Thank you.
    Ionian

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Hi and thanks for the reply.

    Does this work even when the select is built with a short code?
    I’m having a few problem with it and just want iron out a few possibilities.

    So the select would look like:

    <select name=”io-country” class=”wpcf7-form-control wpcf7-select wpcf7-validates-as-required” aria-required=”true” >

    Where the $tag->name would be “io-country”?

    Thank you
    Ian

    I can get this to work and provide a custom response if I use the CF7 code in the form:
    <label>TEST SELECT *[select* test-select]</label>

    but if I create the select using a custom shortcode.
    <label>TEST SELECT *[io_test_select]</label>

    Thanks again for any clarity on this.
    Ian.

    • This reply was modified 1 month, 3 weeks ago by ionian.
    Plugin Author Takayuki Miyoshi

    (@takayukister)

    See Adding a custom form-tag

    You can’t use WP shortcodes in a form template of Contact Form 7.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.