最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html5 - Adding custom attributes to input fields in Contact Form 7 tags

programmeradmin0浏览0评论

I want to open camera and save the picture taken. I don't want to upload saved picture. This can be done using the HTML5 - attribute:

How can I add this capture attribute to my input tag in Contact Form 7 ?

I want to open camera and save the picture taken. I don't want to upload saved picture. This can be done using the HTML5 - attribute:

How can I add this capture attribute to my input tag in Contact Form 7 ?

Share Improve this question edited May 20, 2020 at 20:06 Aurovrata 1,34611 silver badges18 bronze badges asked May 2, 2020 at 10:12 NaMoSa TubeNaMoSa Tube 11 silver badge1 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

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.

发布评论

评论列表(0)

  1. 暂无评论