Failed to set the value property error in Contact Form 7

Hi, Iā€™m running into the same error so i will try to explain it in more detail.

:spiral_notepad: Description

What iā€™m trying to do is to add an ā€˜file upload fieldā€™ to the contact form 7 form. The input button renders correctly and the window to upload a file opens. The form template looks like this.

Your name
[text* your-name]

Your email
[email* your-email]

Subject
[text* your-subject]

Your message (optional)
[textarea your-message]

[file]

[submit ā€œSubmitā€]

But upon submitting a file the page turns blank and the following error shows up in the console.

:computer: Error

As far as i can tell the contact form 7 package tries to set the value of the file input field in the same way it does the normal input fields and causes it to break.

:point_right: Other information

To reproduce:

  • Add contact-form-7 package to frontity install
  • Add contact form 7 plugin to wordpress
  • Add shortcode to page (form works)
  • Add [file] field to form template (form breaks)

Hi @sebastiaan,

Welcome to the Community!

Can you please provide a repo or code-sandbox with your code? This is especially helpful to find solutions of technical issues with specific code

As this package has been created by an external contributor (@imranhsayed) you should open an issue in the pluginā€™s repo so the author can tell you if the Fronrity package is prepared to deal with file fields

I am not quite sure, but I think the plugin only supports some basic input types - file might be one that isnā€™t supported (yet)

1 Like

After looking over the repo it does look like the package does not have support for file upload yet, i will look at another form solution. Thanks for the replies.

Hi @phn, @sebastiaan

The current version of the Frontity Contact Form 7 package is fairly rudimentary and only supports input type=text and textarea fields, so file upload is not supported, nor are select form elements or other input types such as radio or checkbox.

As far as weā€™re aware Imran doesnā€™t seem to be supporting it anymore, but itā€™s released under the GPLv2 licence, so feel free to fork it and develop it further to update/enhance it, or contribute to the existing project. Support for more form elements would be useful for anyone working with Frontity and CF7.