Title: Adding Headers to drop down
Last modified: August 30, 2016

---

# Adding Headers to drop down

 *  [MoxieMark](https://wordpress.org/support/users/moxiemark/)
 * (@moxiemark)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/)
 * What the best way to go about adding headers to my drop down selection?
 * Example:
 * **Fruit**
    Apple Orange Pear **Veggies** Celery Carrots Beets
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

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

 *  [davmerit](https://wordpress.org/support/users/davmerit/)
 * (@davmerit)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549379)
 * > What the best way to go about adding headers to my drop down selection?
 * You may achieve this by using HMTL5 <optgroup> as follows​.
 *     ```
       <select name="my-name">
           <optgroup label="Fruit">
              <option>Apple</option>
              <option>Orange</option>
              <option>Pear</option>
           </optgroup>
           <optgroup label="Veggies">
              <option>Celery</option>
              <option>Carrots</option>
              <option>Beets</option>
           </optgroup>
       </select>​​
       ```
   
 * **note:** you need to add a `name` attribute the `<select>` to be able to display
   the selected option in your email.
    ​ Lastly in the mail section, simply add 
   the name attribute you used in the `<select>` like so, `[my-name]`
 *  [crabsandwich](https://wordpress.org/support/users/crabsandwich/)
 * (@crabsandwich)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549438)
 * Hi,
 * Sorry for not understanding this i am new to WP but where would i add that html
   into the contact form 7 plugin?
 * Thanks
    Alex
 *  [davmerit](https://wordpress.org/support/users/davmerit/)
 * (@davmerit)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549439)
 * ​​​Please include a link to your Contact Form 7 form plus all your input in the
   Form of the CF7 interface. I would guide you with the code and where to pate 
   it. 🙂
 * ​​
    See Contact Form 7 Interface at [https://cacoo.com/diagrams/2xhVwuNicE1G20Df-6E3D9.png](https://cacoo.com/diagrams/2xhVwuNicE1G20Df-6E3D9.png)
 * Please supply the info you have used in the sections marked 4 & 6 in that image.
 * Many people just paste the relevant sections as code here.
 * For example the info from the default CF7 form looks like this:
 * FORM:
 *     ```
       Your Name (required)
           [text* your-name]
       Your Email (required)
          [email* your-email]
       Subject
           [text your-subject]
       Your Message
           [textarea your-message]
       [submit "Send"]
       ```
   
 * MAIL:
 *     ```
       To:
       name@example.com
       From:
       [your-name] <[your-email]>
       Subject:
       [your-subject]
       ```
   
 * MESSAGE BODY:
 *     ```
       From: [your-name] <[your-email]>
       Subject: [your-subject]
       Message Body:
       [your-message]
       --
       This mail is sent via contact form on WordPress http:example.com
       ```
   
 * Others use image sharing sites like [http://photobucket.com/](http://photobucket.com/)
   and [http://tinypic.com/](http://tinypic.com/)
 * .
 * ​​
 *  [crabsandwich](https://wordpress.org/support/users/crabsandwich/)
 * (@crabsandwich)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549440)
 * Hi,
 * Thanks for getting back to me and giving me a few pointers on posting.
 * My situation is a little different as i am using Contact Form 7 – PayPal Add-
   on – Pro. Which also redirects users to a Paypal payment page.
 * The issue is that if a user clicks on one of the heading selections then the 
   Paypal form errors, because there is no price. (indicated by the pipe)
 * Therefore i need to make the selections “Baby Massage” and “Family Yoga” un-clickable.
 * I then of course need to consider how this works with the mail.
 * Form
 *     ```
       <p>Which course are you interested in?*</p>
       <br />
       <p>[select menu-865
       "Baby Massage"
       "- Kensal Rise full course £70|70.00"
       "- Chiswick full course £60|60.00"
       "- Daddy Only workshop £20|20.00"
       "- Couples/Family workshop £30|30.00 per couple"
       "Family & Childrens Yoga"
       "- Chiswick Arch 197 2+ yrs full term £48|48.00"
       "- Chiswick Crown & Anchor 2+ full term £48|48.00"
       "- Kensal Rise 2-4 yrs full term £40|40.00"
       "- Kensal Rise 4-7 yrs full term £42|42.00 "
   
       ]</p>
       ```
   
 * Mail
 *     ```
       <p>Your Name*<br />
           [text* your-name] </p>
   
       <p>Your Email* <br />
           [email* your-email] </p>
   
       <p>Contact Number <br />
           [tel tel-582]  </p>
   
       <p>Child's Age*<br />
           [text* childs-age] </p>
   
       <p>Course purchased<br />
       [menu-865] </p>
   
       <p>Quantity <br />
       [menu-600] </p>
   
       <p>[submit "Send"]</p>
       ```
   
 * Thank you
    Alex
 *  [davmerit](https://wordpress.org/support/users/davmerit/)
 * (@davmerit)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549441)
 * > My situation is a little different as i am using Contact Form 7 – PayPal Add-
   > on – Pro.
 * I can confirm that the solution I have provided above would work with Contact
   Form 7. (I have tested it. see [thread](https://wordpress.org/support/topic/html5-in-mail-section?replies=3)).
 * However I am not sure how the outcome will be for CF7 and PayPal Add-on – Pro.
   I would have to look into is before I can provide you with a suitable solution.
 * Is the add-on you are using the same as [https://wordpress.org/plugins/contact-form-7-paypal-add-on/installation/](https://wordpress.org/plugins/contact-form-7-paypal-add-on/installation/)?
 *  [crabsandwich](https://wordpress.org/support/users/crabsandwich/)
 * (@crabsandwich)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549442)
 * Yes, the add on is the same as that.
 * Thanks
    Alex
 *  [crabsandwich](https://wordpress.org/support/users/crabsandwich/)
 * (@crabsandwich)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549443)
 * I have now implemented the following but with the pipe being representative of
   the value to be pulled through to Paypal it doesn’t work and shows up in the 
   option.
 *     ```
       <p><select menu-865>
       <optgroup label="Baby Massage">
       <option value="|70">Kensal Rise full course £70</option>
       <option>Chiswick full course £60|60.00</option>
       <option>Daddy Only workshop £20|20.00</option>
       <option>Couples/Family workshop £30|30.00 per couple</option>
       <optgroup label="Family & Childrens Yoga">
       <option>Chiswick Arch 197 2+ yrs full term £48|48.00</option>
       <option>Chiswick Crown & Anchor 2+ full term £48|48.00</option>
       <option>Kensal Rise 2-4 yrs full term £40|40.00</option>
       <option>Kensal Rise 4-7 yrs full term £42|42.00</option>
       </optgroup>
       </select>
       </p>
       ```
   
 *  [crabsandwich](https://wordpress.org/support/users/crabsandwich/)
 * (@crabsandwich)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549444)
 * Also here is a link to my form
    [http://www.milestonesbabymassage.com/test](http://www.milestonesbabymassage.com/test)
   I thought i had included it earlier

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

The topic ‘Adding Headers to drop down’ 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/)

## Tags

 * [drop-down](https://wordpress.org/support/topic-tag/drop-down/)
 * [headers](https://wordpress.org/support/topic-tag/headers/)

 * 8 replies
 * 3 participants
 * Last reply from: [crabsandwich](https://wordpress.org/support/users/crabsandwich/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/adding-headers-to-drop-down/#post-6549444)
 * Status: not resolved