Weird Formit Issues - Call changes not being processed

I’ve been trying to get a Formit signup form working and i’ve got some weird issues happening.

IE:No matter how many times i change the &emailTpl, &emailSubject and &emailTo

values the form keeps using the original values.

I’ve even tried creating whole new resources and chunks and nothing in form changes.

That is I can make changes to the Resource Title and text on the page and see that those take.

But when I change the values in the Formit, even though i can see the changes in the chunk, when I run the form on the site it reverts to the old Tpl, email address and Subject.

Has me mystified.

Can’t be caching issue unless Formit has its own weird caching process.

Anyone come across this before?

Are you calling the placeholders uncached?
e.g. [[!+placeholder_name]]

Can you show all the code you’re using?

1 Like

Here’s what i ceurrently have

[[!FormIt?
  &hooks=`email,redirect`
  &emailTpl=`subResponseTpl`
  &emailSubject=`[[++site_name]] Message from Me`	
  &emailTo=`stories@ampli.buzz`
  &redirectTo=`25`           
  &validate=`email:email:required` 
]]

It’s not using that Tpl or subject or email address.

It uses previous ones.

Here’s the form

[[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]           

<form method="post" action="[[~[[*id]]]]">
<div class="row">
<div class="col-md-3">
    <div class="input-group">
        <input type="text" class="form-control" placeholder="First Name..." autocomplete="fullname" name="firstname" id="firstname" value="[[!+fi.firstname]]" />
    </div>
</div>
<div class="col-md-3">
    <div class="form-group">
        <input type="text" class="form-control" placeholder="Last Name..." autocomplete="name" name="lastname" id="lastname" value="[[!+fi.lastname]]" />
    </div>
</div>
<div class="col-md-3">
    <div class="form-group">
        <input type="email" class="form-control" placeholder="Email..." name="email" id="email" value="[[!+fi.email]]" />
    </div>
</div>
<div class="col-md-3">
    <div class="form-group">
        <button type="submit" class="btn btn-primary btn-round btn-block">Get Secrets</button>
    </div>
</div>

and the Tpl

<p>[[+firstname]], </p>
<p>Thanks for signing up.</p>

But as i said it doesn’t use that one.

How can it be using things different to what’s specified in the call?

What I mean is the form works and sends me an email but uses a differnt template, email address and subject.

I can’t see anything wrong in your setup (aside from the missing html and autocomplete stuff). Any luck with muzza’s suggestion of calling the placeholders uncached in the email chunk?

<p>[[!+firstname]]</p>

I’m going to start from scratch to see if I can figure out where i went wrong.

This is just bizarre.

I even changed the redirect page and even that didn’t take, so there’s some problem in the call.

[[!FormIt?
  &hooks=`email,redirect`
  &emailTpl=`subResponseTpl`
  &emailSubject=`[[++site_name]] Message from Me`	
  &emailTo=`stories@myemail
  &redirectTo=`1`           
  &validate=`email:email:required` 
]]

None of those values are being read by the rest of the form.

The call looks fine. Try this…

Create a snippet called markHook and place this in it:

<?php $modx->log(modX::LOG_LEVEL_ERROR, 'My hooks are working fine.');

Use this formit call and submit the form (it wont do anything). Then go and check your error log and ensure that the message above is printing out to the modx console.

[[!FormIt? &hooks=`markHook` ]]

If it works then go ahead and restore your original call and place the markHook at the start of the hook order and submit the form. Does it still log out to the console? If so but you’re still not getting any results then try taking out validation, redirect, keep stripping the form down until it works and then build it back up until it breaks. Narrow down exactly what’s causing the problem.

Ok, finally figured out the problem.

I had another signup option in my top menu bar, using similar formit code.

When i got rid of the nav bar option the main signup form worked as planned.

Mystery solved, been driving me nuts all day.

However, I still want to have a subscribe button in the nav bar and a proper form on the page.

I wonder if that’s possible?

aha :slight_smile:

yeah there’s a submitVar property you can use to say what element submits which form (check documentation for specifics)

3 Likes

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”.