Title: Validate custom form
Last modified: August 21, 2016

---

# Validate custom form

 *  [isaki](https://wordpress.org/support/users/isaki/)
 * (@isaki)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/validate-custom-form/)
 * Hi,
    Is there a way to validate a custom form/your own html code ?
 * Short explanation what I have done:
    With the help of the plugin ‘Shortcode Exec
   PHP’ and the ability to execute shortcodes in contact-form-7 I have built a function
   that take a GET-variable and draw up the html inside the form.
 * So the only code I have put in the contact-form-7 form-builder is:
 *     ```
       [getallnames][/getallnames] <-- The PHP function shortcode
   
       [hidden step "1-2"]
       <p>[submit "Next"]</p>
       ```
   
 * The PHP-function draw something like this:
    `<span class="wpcf7-form-control-
   wrap first-name"><input type="text" name="first-name" value="" size="40" class
   ="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" id="fName" aria-
   required="true" placeholder="First Name"></span>`
 * (of course the id is uniqe when I iterate and draw up the html)
 * The problem is that the above isn’t validated and sends even if it is empty.
   
   Any one got any god idea ?
 * Regards
 * [http://wordpress.org/plugins/contact-form-7/](http://wordpress.org/plugins/contact-form-7/)

The topic ‘Validate custom form’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [isaki](https://wordpress.org/support/users/isaki/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/validate-custom-form/)
 * Status: not resolved