Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add id to "contact form 7" form

I'm trying to add an id to my cf7 form. According to cf7 forum, all you have to do is to add html_id="your id" to the short code, but for some reason, it doesn't work.

This is my shortcode -

[cf7-form id="hp-top-partial" html-id="cf7-hp-top-partial" html_class="form nini-form" cf7key="question"]

Any suggestions?

like image 385
Tommiz Avatar asked May 03 '17 07:05

Tommiz


Video Answer


3 Answers

You can add id to any field in cf7.

[text* Name id:name class:input_box placeholder "Name"]
like image 91
Vipin Avatar answered Oct 10 '22 04:10

Vipin


try this short code for “contact form 7” form

[contact-form-7 id="hp-top-partial" title="Contact form 1" html_id="contact-form-hp-top-partial" html_class="form contact-form"]
like image 20
Shital Marakana Avatar answered Oct 10 '22 05:10

Shital Marakana


Yes. You can add any id and class to a form by adding the html_id and html_class attributes into a [contact-form-7] shortcode.

Example:

[contact-form-7 id="1234" title="Contact form 1" html_id="contact-form-1234" html_class="form contact-form"]
like image 43
Tayyab Khalid Avatar answered Oct 10 '22 03:10

Tayyab Khalid