Shortcode for creating a form
-
Hi, i want to do something like this:
add_action('wpcf7_init', 'my_func'); function my_func() { wpcf7_add_form_tag('my_form', function ($tag) { $html = ' <div class="row"> <div class="col-md-6"> <p>Name*:<br>' . wpcf7_do_shortcode('[text* your-name]') . '</p> <p>E-Mail*:<br>' . wpcf7_do_shortcode('[email* your-email]') . '</p> <p>' . wpcf7_do_shortcode('[submit "Send"]') . '</p> </div> </div>" '; return $html; }); }
and in the wordpress Backend form tab i want to write [my_form]. This is working, but there is no validation. If i write the html directly into the form tab the validation is working. How can i enable the validation?
- The topic ‘Shortcode for creating a form’ is closed to new replies.