Formit not processing specific field

I have an issue with a contact form that will not process the name field. The field name is in the email template however, its shows as [[+name]] instead of the name submitted. I am not sure what I am doing wrong.

This is my snippet call:

[[!FormIt? &hooks=`email` emailHtml=`0` &emailTpl=`formit_email` &emailTo=`[email protected]` &emailFrom=`[email protected]` &emailSubject=`Contact Form Submitted` &validate=`nospam:blank, email:email:required, subject:required, message:required:stripTags` &successMessage=`Message successfully sent!` ]]

my form section of this field:

Your Name[[!+fi.error.name]]

My email TPL:

A contact form was submitted on your website with the following details:
[[+name]]
[[+email]] Wrote:
[[+subject]]
[[+message]]

The result email sent looks like this:

a contact form was submitted on your website with the following details:
[[+name]]
([email protected]) Wrote:
My subject line
My message text

So what is your markup for this field exactly?

(Please use a code block to enter the HTML markup in the post, so that all tags remain visible.
Here is how you create a code block in this forum:)

```// put a line with 3 back-ticks at the beginning
// put your code or HTML markup here
```// put a line with 3 back-ticks at the end

I tested FormIt with the following HTML in the form, and that seems to work. (The [[+name]] tag in the email-chunk got replaced correctly.)

<div> 
   [[!+fi.error.name]] 
   <label for="name">Name</label> 
   <input type="text" name="name" value="[[!+fi.name]]"> 
</div>

Make sure that when the form is sent, the POST request has a request parameter with the key name.

1 Like

Thanks for taking the time Harry. the markup got flagged in my OP and was blocked by the forum Akismet because I Copy/pasted HTML code and then I couldn’t edit.

This is my form field:

<div class="form-floating">
<input class="form-control" type="text" value="[[!+fi.name]]" placeholder="Your Name"> 
<label for="name">Your Name</label>
<span class="error">[[!+fi.error.name]]</span></div>
</div> 

I can see its missing the name=”name” from the input field. (had the page set to Rich Text and that seemed to remove it whenever I saved. I changed to not Rich Text and readded the name=”name” to the input and now its working as expected.

Thank you very much!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.