Title: html
Last modified: December 23, 2020

---

# html

 *  [msslrb](https://wordpress.org/support/users/msslrb/)
 * (@msslrb)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/html-53/)
 * I would like to add number fields to a contact form using html instead of Contact
   Form 7 shortcodes.
 * **The code is:**
 * <input required class=”miles” type=”number” pattern=”/^-?d+.?d*$/” onKeyPress
   =”if(this.value.length==1) return false;” /><span style=”font-size:38px;”>,</
   span><input required class=”miles” type=”number” pattern=”/^-?d+.?d*$/” onKeyPress
   =”if(this.value.length==1) return false;” /><input required class=”miles” type
   =”number” pattern=”/^-?d+.?d*$/” onKeyPress=”if(this.value.length==1) return 
   false;” /><input required class=”miles” type=”number” pattern=”/^-?d+.?d*$/” 
   onKeyPress=”if(this.value.length==1) return false;” /><span style=”font-size:
   38px;”>,</span><input required class=”miles” type=”number” pattern=”/^-?d+.?d*
   $/” onKeyPress=”if(this.value.length==1) return false;” /><input required class
   =”miles” type=”number” pattern=”/^-?d+.?d*$/” onKeyPress=”if(this.value.length
   ==1) return false;” /><input class=”miles” type=”number” pattern=”/^-?d+.?d*$/”
   onKeyPress=”if(this.value.length==1) return false;” / required ><input required
   style=”margin-top:-40px !important;” class=”miles” type=”number” pattern=”/^-?
   d+.?d*$/” onKeyPress=”if(this.value.length==1) return false;” />
 * [https://drive.google.com/file/d/1C_acdZ2wNnkn6F8QgVobfnLJVdh2hPZW/view?usp=sharing](https://drive.google.com/file/d/1C_acdZ2wNnkn6F8QgVobfnLJVdh2hPZW/view?usp=sharing)
 * How do I add these fields to the email template?
    Also, how do I make the fields
   required? Adding the required tag to the input field doesn’t work.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Yordan Soares](https://wordpress.org/support/users/yordansoares/)
 * (@yordansoares)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/html-53/#post-13828394)
 * Hello [@msslrb](https://wordpress.org/support/users/msslrb/),
 * I’m afraid the `number` form tag doesn’t support the `pattern` attribute or `
   onKeyPress` event, but you can add your own custom form tag following the instructions
   you find here: [Adding a custom form-tag](https://contactform7.com/2015/01/10/adding-a-custom-form-tag/).
 * Best regards,
    Yordan.
 *  Thread Starter [msslrb](https://wordpress.org/support/users/msslrb/)
 * (@msslrb)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/html-53/#post-13828654)
 * The form works fine. It just doesn’t give the validation error.
 * I would like to know how to add any html field submission to the email that I
   received when a form is submitted.
 *  Thread Starter [msslrb](https://wordpress.org/support/users/msslrb/)
 * (@msslrb)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/html-53/#post-13828969)
 * Okay. I created custom form tags. The field populates correctly. However, I’m
   still unable to add it to the email template and make it required.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘html’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [msslrb](https://wordpress.org/support/users/msslrb/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/html-53/#post-13828969)
 * Status: not resolved