Adding custom attributes to input fields in Contact Form 7 tags

You can’t as of now add it to the tag, you’ll need to add a custom file field in your form such as,

<label> Some Text field 
  [text my-text-field] </label>

<label> My image capture 
  <input type="file" id="imgInp" />
  <img id="blah" src="#" alt="your image" /> 
</label>

<script>
//add your custom JS script here
</script>

Note that you will also need some custom JavaScript to render the image, see the link above for more details.

Note also that your custom field will not be parsed by the cf7 plugin, and as a result it will not be validated, you’ll need to do that yourself. It won’t either be available to add to the notification mail, this too you will need to programmatically enable.

tech