FormIt - MODX Community Forums https://forums.modx.com/board/?board=92 <![CDATA[Formit upgrade to 4.1.0 has messed up all previously encrypted stored form data]]> https://forums.modx.com/thread/104569/formit-upgrade-to-4-1-0-has-messed-up-all-previously-encrypted-stored-form-data#dis-post-562504
What a pain!

Cheers,

dubbs.]]>
https://forums.modx.com/thread/104569/formit-upgrade-to-4-1-0-has-messed-up-all-previously-encrypted-stored-form-data#dis-post-562504 Fri, 02 Nov 2018 07:55:02 +0000 https://forums.modx.com/thread/104569/formit-upgrade-to-4-1-0-has-messed-up-all-previously-encrypted-stored-form-data#dis-post-562504
<![CDATA[Multipage and FormitRetreiver and &store Issue]]> https://forums.modx.com/thread/100537/multipage-and-formitretreiver-and-store-issue?page=2#dis-post-562248
Step (Page 1)

 [[!FormIt?
   &hooks=`redirect`
    &validate=`donation_type:required, amount:required`
       &store=`1`
       &storeTime=`1200`
   &redirectTo=`2`
]]  


Step 2 (Page 2)
[[!FormItRetriever]]
 [[!FormIt? &submitVar=`regular-donation` &hooks=`redirect` &store=`1` &validate=`nospam:blank,email:email:required,DonorTitle:required,Donor_FirstName:required,Donor_LastName:required` &redirectTo=`4` ]]


To this stage all works well the information from Page 1 has been stored and appears in the hidden fields of Page 2

Step 3 (Page 3)
[[!FormItRetriever]]
 [[!FormIt? &submitVar=`dd_donation` &hooks=`email,redirect` &validate=`nospam:blank,email:email:required,DonorTitle:required,Donor_FirstName:required,Donor_LastName:required,Donation_Frequency:required` &emailTpl=`regular_donation_emailTpl` &emailTo=`myemail@domain.com`  &redirectTo=`5` ]]


However the fields from Page 2 do not appear, the fields from Page 1 do... The form does not submit because the fields that should appear from Page 2 are not there and these are required fields.

Suggestions please as to why the &store=`1` doesn't appear to be storing the data from Step 2 to Step 3.

Thank you

Environment:

MODX Cloud
Revo 2.5.0
Formit 2.2.10]]>
https://forums.modx.com/thread/100537/multipage-and-formitretreiver-and-store-issue?page=2#dis-post-562248 Mon, 22 Oct 2018 05:02:13 +0000 https://forums.modx.com/thread/100537/multipage-and-formitretreiver-and-store-issue?page=2#dis-post-562248
<![CDATA[Failed Formit 4.1.0 upgrade and now no manager!]]> https://forums.modx.com/thread/104259/failed-formit-4-1-0-upgrade-and-now-no-manager#dis-post-562150
Any ideas what is going on and how to fix???

Looks like same issues here > https://github.com/Sterc/FormIt/issues/183]]>
https://forums.modx.com/thread/104259/failed-formit-4-1-0-upgrade-and-now-no-manager#dis-post-562150 Wed, 17 Oct 2018 03:00:08 +0000 https://forums.modx.com/thread/104259/failed-formit-4-1-0-upgrade-and-now-no-manager#dis-post-562150
<![CDATA[Formit and QuickEmail nothing sent]]> https://forums.modx.com/thread/104461/formit-and-quickemail-nothing-sent#dis-post-561930 https://forums.modx.com/thread/104461/formit-and-quickemail-nothing-sent#dis-post-561930 Fri, 05 Oct 2018 11:05:22 +0000 https://forums.modx.com/thread/104461/formit-and-quickemail-nothing-sent#dis-post-561930 <![CDATA[FormIt Action to Existing PHP Processor]]> https://forums.modx.com/thread/104433/formit-action-to-existing-php-processor#dis-post-561723
I am running into an issue where I have an existing PHP processor with my CRM where presently I have a form stored in a chunk with the action pointed at my CRM (action="https://myCRM.domain.com/form.php").

I want to use FormIt to validate fields and then send the form to my existing action point.

What is the best approach here?
]]>
https://forums.modx.com/thread/104433/formit-action-to-existing-php-processor#dis-post-561723 Mon, 24 Sep 2018 03:46:44 +0000 https://forums.modx.com/thread/104433/formit-action-to-existing-php-processor#dis-post-561723
<![CDATA[Formit not working]]> https://forums.modx.com/thread/92686/formit-not-working?page=2#dis-post-560929
Here's my code which is a cut-down version of the instructions from http://rtfm.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.examples.simple-contact-page

[[!FormIt?
   &hooks=`email,redirect`
   &emailTpl=`MyEmailChunk`
   &emailTo=`[[+email]]`
   &emailFrom=`emailaddress@domain.com` /* changed to protect the innocent */
   &emailSubject=`Portofino FormIt Form`
   &redirectTo=`10`
   &validate=`name:required,
      email:email:required,
      subject:required,
      text:required:stripTags,`
]]

<h2>Contact Form</h2>
 
[[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]
 
<form action="[[~[[*id]]]]" method="post" class="form">
    <input type="hidden" name="nospam:blank" value="[[+fi.nospam]]" />
 
    <label for="name">
        Name:
        <span class="error">[[!+fi.error.name]]</span>
    </label>
    <input type="text" name="name" id="name" value="[[!+fi.name]]" /><br />
 
    <label for="email">
        Email:
        <span class="error">[[!+fi.error.email]]</span>
    </label>
    <input type="text" name="email" id="email" value="[[!+fi.email]]" /><br />
 
    <label for="subject">
        Subject:
        <span class="error">[[!+fi.error.subject]]</span>
    </label>
    <input type="text" name="subject" id="subject" value="[[!+fi.subject]]" /><br />
 
    <label for="text">
        Message:
        <span class="error">[[!+fi.error.text]]</span>
    </label>
    <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea><br /><br />
 
    <br class="clear" />
 
    <div class="form-buttons">
        <input type="submit" value="Send Contact Inquiry" />
    </div>
</form>


and my chunk:

This is the Formit Email Chunk.
 
<br />[[+name]] ([[+email]]) Wrote: <br />
 
[[+text]]


the test page can be viewed at http://portofino.com.ph/modx/test.html

What I have tried:

- Bob's QuickEmail snippet which works no problem (thanks Bob I sent you a donation)

- a simple phpmail() snippet which works no problem

<?php
mail("myemailaddress@mydomain.com","php mail test","this works if you are reading it","From: emailaddress@domain.com");


- installing the same code at another site (hosted by hostgator) which works no problem http://outoftheblue.com.ph/modx/test.html

I can only conclude there is nothing fundamentally wrong with my code, but rather something queer about the interaction of formit and the host.

Any suggestions out there or do I just 'roll my own form' and abandon formit? Two days wasted on this already sad

MODx 2.3.1 traditional
MySQL 5.0.77
PHP Mailer 5.2.8 (can't view phpinfo they have blocked it's use server-side)]]>
https://forums.modx.com/thread/92686/formit-not-working?page=2#dis-post-560929 Mon, 20 Aug 2018 06:33:20 +0000 https://forums.modx.com/thread/92686/formit-not-working?page=2#dis-post-560929
<![CDATA[How to create Resources from the front end FormIt 4.0?]]> https://forums.modx.com/thread/104286/how-to-create-resources-from-the-front-end-formit-4-0#dis-post-560917 Snippets from here https://forums.modx.com/thread/31314/how-to-create-resources-documents-from-the-front-end-with-a-form
not working.

Anyone can help, please?]]>
https://forums.modx.com/thread/104286/how-to-create-resources-from-the-front-end-formit-4-0#dis-post-560917 Sun, 19 Aug 2018 08:13:46 +0000 https://forums.modx.com/thread/104286/how-to-create-resources-from-the-front-end-formit-4-0#dis-post-560917
<![CDATA[FormIT 4.0 update broke manager login]]> https://forums.modx.com/thread/103766/formit-4-0-update-broke-manager-login#dis-post-560805 The error is:
mod_fcgid: stderr: PHP Parse error: syntax error, unexpected '[' in /home/webs60/public_html/core/components/formit/src/FormIt.php on line 24

I installed it on another site to see if it was an update issue and the same thing happened with the same error and stopping me from logging into manager.

Line 24 is:
public $config = [];

Any ideas?]]>
https://forums.modx.com/thread/103766/formit-4-0-update-broke-manager-login#dis-post-560805 Wed, 15 Aug 2018 09:31:05 +0000 https://forums.modx.com/thread/103766/formit-4-0-update-broke-manager-login#dis-post-560805
<![CDATA[SOLVED: Custom Formit Hook]]> https://forums.modx.com/thread/71441/solved-custom-formit-hook#dis-post-560468
I'm having a little issue with a Formit Hook that I made for a 3PC I'm working on. This might be a case of me just staring at it too long and missing something obvious (I'm hoping) so I figured I'd ask here for a new set of eyes.

The Formit call for adding items to my db is as follows:
[[!FormIt?
   &hooks=`erHook,redirect`
   &redirectTo=`[[*id]]`
   &redirectParams=`{"success":"1"}`
   &validate=`name:required,cat_id:required`
   &submitVar=`addItem`
]]


The hook code is as follows:
<?php
$easyrestaurant = $modx->getService('easyrestaurant','Easyrestaurant',$modx->getOption('easyrestaurant.core_path',null,$modx->getOption('core_path').'components/easyrestaurant/').'model/easyrestaurant/',$scriptProperties);
if (!($easyrestaurant instanceof Easyrestaurant)) return '';

$edit = $hook->getValue('edit');
$itemid = $hook->getValue('itemid');

if($edit == 1) { $easyrestaurant_hook = $modx->getObject('erItems',$itemid); } else { $easyrestaurant_hook = $modx->newObject('erItems'); }
if (empty($easyrestaurant_hook)) {return 'I didn\'t get an object..';}
$easyrestaurant_hook->fromArray($scriptProperties['fields']);
$easyrestaurant_hook->save();
return true;


Editing items works great... Things are saving to the database successfully.. no problems there.

For some reason...I can't create new items though. The form is completely processed and returns with the success param, but no new items are in the database.

My initial inclination was that I was passing the edit field to the form accidentally and it was trying to edit an item that didn't exist, but I did some error checking there and it appears to be properly executing the "else" statement.

What are my tired eyes missing?

Thanks in advance!
-Jared]]>
https://forums.modx.com/thread/71441/solved-custom-formit-hook#dis-post-560468 Tue, 07 Aug 2018 01:35:32 +0000 https://forums.modx.com/thread/71441/solved-custom-formit-hook#dis-post-560468
<![CDATA[Formit 4.1.0 on Revo 2.6.5]]> https://forums.modx.com/thread/104168/formit-4-1-0-on-revo-2-6-5#dis-post-560283
An error occurred while trying to send the email. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting


Error logo shows these:

[2018-07-30 21:13:22] (ERROR @ /public_html/core/components/formit/src/FormIt/Request.php : 87) [FormIt] Could not load FormItReCaptcha service class.
[2018-07-30 21:13:22] (ERROR @ /public_html/core/components/formit/src/FormIt/Hook/Email.php : 303) [FormIt] An error occurred while trying to send the email. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting


Any ideas?]]>
https://forums.modx.com/thread/104168/formit-4-1-0-on-revo-2-6-5#dis-post-560283 Tue, 31 Jul 2018 08:11:52 +0000 https://forums.modx.com/thread/104168/formit-4-1-0-on-revo-2-6-5#dis-post-560283
<![CDATA[Formatting checkboxes when displaying results with FormItRetriever]]> https://forums.modx.com/thread/104140/formatting-checkboxes-when-displaying-results-with-formitretriever#dis-post-560074
Got a question that's been bugging me all morning as I try to convert an email form to one that displays on a webpage for the user to then print. I have a form set up with FormIt so that when the user hits submit, it goes to a new page and displays all the form fields with FormItRetriever. It's a nitpick, but I want to display checkbox values on separate lines, rather than the default comma separated.

e.g.

value 1
value 2

rather than

value 1,value 2

With email, I know I can format this with &emailMultiWrapper and &emailMultiSeparator in the FormIt call. Is there any way to do this with FormItRetriever?

Thanks in advance,

Kahli]]>
https://forums.modx.com/thread/104140/formatting-checkboxes-when-displaying-results-with-formitretriever#dis-post-560074 Fri, 27 Jul 2018 01:56:13 +0000 https://forums.modx.com/thread/104140/formatting-checkboxes-when-displaying-results-with-formitretriever#dis-post-560074
<![CDATA[FormIt 4.0 / 4.1 "Fatal error: Class 'Sterc\FormIt' not found"]]> https://forums.modx.com/thread/103984/formit-4-0-4-1-fatal-error-class-sterc-formit-not-found#dis-post-559253
I was about to update FormIt from 3.0.4 to the latest version 4.1.0.

My contact form works fine under 3.x and prior, but for any 4.x version my page shows following error:

Fatal error: Class 'Sterc\FormIt' not found in /www/htdocs/###/core/components/formit/model/formit/formit.class.php on line 28

I had a look at this file, and it has changed from prior versions. For now I reverted back to 3.0.4 but would like to figure out what went wrong.

I'm running my page with MODX Revolution 2.6.3-pl under PHP7.0.

Does anyone have similar issues, or an idea what the issue may be?

Thank you
Mark]]>
https://forums.modx.com/thread/103984/formit-4-0-4-1-fatal-error-class-sterc-formit-not-found#dis-post-559253 Tue, 26 Jun 2018 11:31:20 +0000 https://forums.modx.com/thread/103984/formit-4-0-4-1-fatal-error-class-sterc-formit-not-found#dis-post-559253
<![CDATA[How to collect different forms to one result?]]> https://forums.modx.com/thread/103925/how-to-collect-different-forms-to-one-result#dis-post-558958
I'm using a formit to a resultpage (id=12) where I want to show both name1 and name2. I use the store-function of FormIt to keep the data in session.

[[!FormItRetriever? &storeLocation=`session`]]

[[!FormIt? 
&submitVar=`send`
&hooks=`redirect`
&redirectTo=`12`
&store=`1`
&storeLocation=`session`
&storeTime=`900`
]]

on the resultpage I call [[+fi.name1]] and [[+fi.name2]]


The problem is that only the last filled in name is showed on the resultpage. So if I last fill in name2 then name1 is blank on the resultpage and name2 is filled in and vice versa.

Am I getting crazy or why is this not working?]]>
https://forums.modx.com/thread/103925/how-to-collect-different-forms-to-one-result#dis-post-558958 Thu, 07 Jun 2018 06:47:50 +0000 https://forums.modx.com/thread/103925/how-to-collect-different-forms-to-one-result#dis-post-558958
<![CDATA[How to display success message?]]> https://forums.modx.com/thread/103878/how-to-display-success-message#dis-post-558682
[[!FormIt?
&hooks=`email,attachment`
&emailTpl=`[[+emailChunk]]`
&emailTo=`[[+teamselect]]`
&attachment=`[[+filedata]]`
&emailSubject=`Request from [[+formName]]`
&emailFromName=`Profiles`
&emailFrom=`Profiles@xjtlu.edu.cn`
&validate=`[[+validation:default=`
formName:required,
formEmailAddress:email:required,
teamselect:required,
formQuery:required,
whatAreYouDoing:blank
`]]`
&successMessage=`Your comment has been submitted successfully.`
&validationErrorMessage=`<div class="alert alert-error">
<h3>Please review the following errors:</h3>
<ul>
[[!+fi.error.formName:!empty=`<li><a href="[[~[[*id]]]]#formName">Name is a required field</a></li>`]]
[[!+fi.error.formEmailAddress:!empty=`<li><a href="[[~[[*id]]]]#formEmailAddress">Email is a required field</a></li>`]]
</ul>
</div>`
]]


[[!+fi.validation_error_message:!empty=`
<div class="alert alert-error xjtlurequest">
<h3>Please review the following errors:</h3>
<ul>
[[!+fi.error.formName:!empty=`<li><a href="[[~[[*id]]]]#formName">Name is a required field</a></li>`]]
[[!+fi.error.formEmailAddress:!empty=`<li><a href="[[~[[*id]]]]#formEmailAddress">Email is a required field</a></li>`]]
</ul>
</div>`]]

[[!fi.successMessage]]

<div class="well xjtlurequest">
<form method="post" action="[[~[[*id]]]]" id="[[+formId:default=`contact-us`]]" enctype="multipart/form-data">
<fieldset>
<legend>Contact Us</legend>
<input type="hidden" value="[[*pagetitle]]" name="formPage" id="formPage">
<p>
<label for="formName">Name [[!+fi.error.formName:notempty=`[[!+fi.error.formName]]`]]</label>
<input type="text" name="formName" id="formName" value="[[!+fi.formName]]">
</p>
<p>
<label for="formEmailAddress">Email [[!+fi.error.formEmailAddress:notempty=`[[!+fi.error.formEmailAddress]]`]]</label>
<input type="email" name="formEmailAddress" id="formEmailAddress" value="[[!+fi.formEmailAddress]]">
</p>
<p>
<label for="formPhoneNumber">Telephone [[!+fi.error.formPhoneNumber:notempty=`[[!+fi.error.formPhoneNumber]]`]]</label>
<input type="text" name="formPhoneNumber" id="formPhoneNumber" value="[[!+fi.formPhoneNumber]]">
</p>

<label for="teamselect">Please chose a thing for requesting....
[[!+fi.error.teamselect:notempty=`[[!+fi.error.teamselect]]`]]</label>
<select name="teamselect">
<option value="News@xjtlu.edu.cn" [[!+fi.teamselect:FormItIsSelected=`News@xjtlu.edu.cn`]] >News</option>
<option value="News@xjtlu.edu.cn" [[!+fi.teamselect:FormItIsSelected=`News@xjtlu.edu.cn`]] >Events</option>
<option value="Marketing@xjtlu.edu.cn" [[!+fi.teamselect:FormItIsSelected=`Marketing@xjtlu.edu.cn`]] >Web Content Update</option>
<option value="zhefei.zhu@xjtlu.edu.cn" [[!+fi.teamselect:FormItIsSelected=`zhefei.zhu@xjtlu.edu.cn`]] >Web Tech Matters</option>
<option value="439973358@qq.com" [[!+fi.teamselect:FormItIsSelected=`439973358@qq.com`]] >General Matters</option>
</select>

<p>
<label for="formQuery">Request [[!+fi.error.formQuery:notempty=`[[!+fi.error.formQuery]]`]]</label>
<textarea rows="5" cols="30" name="formQuery" id="formQuery" wrap="hard">[[!+fi.formQuery]]</textarea>
</p>

<p>
<input id="filedata" name="filedata" type="file" value="[[+fi.filedata]]">
</p>

<p>
<button type="submit">Send</button>
<input type="hidden" name="whatAreYouDoing" value="">
[[!FormItRetriever]]
</p>
</fieldset>
</form>
</div>
]]>
https://forums.modx.com/thread/103878/how-to-display-success-message#dis-post-558682 Tue, 22 May 2018 03:04:12 +0000 https://forums.modx.com/thread/103878/how-to-display-success-message#dis-post-558682
<![CDATA[Bulk delete FormIt submissions]]> https://forums.modx.com/thread/103834/bulk-delete-formit-submissions#dis-post-558547 I have been making a form for a client. The submissions are saved using the the FormItSaveForm hook. When the client need the submission data, they go to the Extra/Formit menu and export a csv-file. They can remove/delete the submissions one by one.

I would like to make it possible to bulk delete these submission, but where do I start? Anyone who could point me in the right direction? An option for bulk deleting uploaded files in the mediabrowser would be nice too.

Best regards Gitte]]>
https://forums.modx.com/thread/103834/bulk-delete-formit-submissions#dis-post-558547 Mon, 14 May 2018 09:28:25 +0000 https://forums.modx.com/thread/103834/bulk-delete-formit-submissions#dis-post-558547
<![CDATA["Form Select" dropdown in formit CMP]]> https://forums.modx.com/thread/103769/form-select-dropdown-in-formit-cmp#dis-post-558339
The 'Form Select' dropdown list in the Formit CMP is empty, even though I have at least 5 different forms. I cannot select any. Should I enter some value for a variable in the systems settings?

Tnx for your help

Ludo
]]>
https://forums.modx.com/thread/103769/form-select-dropdown-in-formit-cmp#dis-post-558339 Thu, 03 May 2018 01:38:13 +0000 https://forums.modx.com/thread/103769/form-select-dropdown-in-formit-cmp#dis-post-558339
<![CDATA[Formit 4.0 - cannot have two forms on the same page]]> https://forums.modx.com/thread/103782/formit-4-0---cannot-have-two-forms-on-the-same-page#dis-post-558292
Two forms on one and the same page. That should be no problem.

But do try the following code - and have it executed on a modx installation with formit 4.0.

[[!formit? &hooks=`redirect` &store=`1` &redirectTo=`90` &submitVar=`foo`]]

<form id="form1" action="[[~[[*id]]]]" method="post">
    <input type="submit" name="foo" class="btn btn-primary" value="Submit Inquiry">
</form>

<p>Something else</p>

[[!formit? &hooks=`redirect`  &store=`1` &redirectTo=`90` &submitVar=`bar`]]

<form id="form2" action="[[~[[*id]]]]" method="post">
    <input type="submit" name="bar" class="btn btn-primary" value="Submit Inquiry">
</form>


The first submit button executes the redirect. The second one doesn't do anything.

Is that a bug?

KInd regards

Ludo
]]>
https://forums.modx.com/thread/103782/formit-4-0---cannot-have-two-forms-on-the-same-page#dis-post-558292 Mon, 30 Apr 2018 05:48:54 +0000 https://forums.modx.com/thread/103782/formit-4-0---cannot-have-two-forms-on-the-same-page#dis-post-558292
<![CDATA[formit succes message]]> https://forums.modx.com/thread/47588/formit-succes-message?page=3#dis-post-557948
I have an e-mail form which returns to the same page after sending.
I want to give the user a confirmation. Something basic, like "Your message has been send!" above the form.

I think I need to use hooks... but how? Can anybody help me? Thanks!]]>
https://forums.modx.com/thread/47588/formit-succes-message?page=3#dis-post-557948 Wed, 11 Apr 2018 02:05:00 +0000 https://forums.modx.com/thread/47588/formit-succes-message?page=3#dis-post-557948
<![CDATA[FormIT: What is the error here?]]> https://forums.modx.com/thread/103564/formit-what-is-the-error-here#dis-post-557260

[[!FormIt?
&hooks=`recaptcha,spam,email,redirect,FormItSaveForm`
&formName=`Contact Form`
&emailTpl=`ChemicalDistributorAndSupplierFormTpl`
&emailSubject=`Admin - Nexeo Contact Form!`
&emailTo=`brandon.mandria@gmail.com`
&redirectTo=`123`
&validate=`
fname:required,
lname:required,
email:email:required,
company:required,
phone:required,
province:required,
subject:required,
message:required:stripTags,
select1:required,
select2:required`
]]

<div style="border: 2px solid #d5d5d5; background-color: #f3f3f3; width: 400px; margin: 0 auto; padding: 1em; font-family: Lato;">


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

<form action="[[~[[*id]]]]" method="post" class="form">
<h1 style="font-size: 32px; color: green; text-align: center;">Have a Question?</h1>
<p style="text-align: center; padding: 15px;">Fill out the form below to be contracted by a Sales team Member</p>
<input type="hidden" name="nospam" value="" />

<p style="text-align: center;">
<input style="width: 45%; border: 1px solid #d5d5d5; padding: 5px; color: #878585;" type="text" value="[[!+fi.fname]]" name="fname" id="fname" placeholder="First Name*"/>
<input style="width: 45%; border: 1px solid #d5d5d5; padding: 5px; color: #878585;" type="text" value="[[!+fi.lname]]" name="lname" id="fname" placeholder="Last Name*" />
</p>
<p style="text-align: center;">
<span class="error" style="font-size:10px;color:red;float:left;position:relative;left:20px;">[[!+fi.error.fname]]</span>
<span class="error" style="font-size:10px;color:red;position:relative;left:5px;">[[!+fi.error.lname]]</span>
</p>
<p style="text-align: center;">
<input style="width: 91%; border: 1px solid #d5d5d5; padding: 5px; color: #878585;" type="text" value="[[!+fi.email]]" name="email" id="email" placeholder="Email Address*"/>
</p>
<p style="text-align: center;">
<span class="error" style="font-size:10px;color:red;float:left;position:relative;left:20px;">[[!+fi.error.email]]</span>
</p>
<p style="text-align: center;">
<input style="width: 91%; border: 1px solid #d5d5d5; padding: 5px; color: #878585;" type="text" value="[[!+fi.company]]" name="company" id="company" placeholder="Company Name"/>
</p>
<p style="text-align: center;">
<span class="error" style="font-size:10px;color:red;float:left;position:relative;left:20px;">[[!+fi.error.company]]</span>
</p>
<p style="text-align: center;">
<input style="width: 91%; border: 1px solid #d5d5d5; padding: 5px; color: #878585;" type="text" value="[[!+fi.phone]]" name="phone" id="phone" placeholder="Phone Number"/>
</p>
<p style="text-align: center;">
<span class="error" style="font-size:10px;color:red;float:left;position:relative;left:20px;">[[!+fi.error.phone]]</span>
</p>
<p style="text-align: center;">
<input style="width: 91%; border: 1px solid #d5d5d5; padding: 5px; color: #878585;" type="text" value="[[!+fi.province]]" name="province" id="province" placeholder="State/Province*"/>
</p>
<p style="text-align: center;">
<span class="error" style="font-size:10px;color:red;float:left;position:relative;left:20px;">[[!+fi.error.province]]</span>
</p>

<p style="padding: 0 20px 0 20px; font-size: 14px;">Has you current company purchased from Nexeo Solutions in the past?</p>
<select style="width: 90%; left: 20px; position: relative; padding: 5px; color: #878585;" name="select1" value="[[!+fi.select1]]">
<option value="">Select an option...</option>
<option value="one" [[!+fi.select1:FormItIsSelected=`yes`]]>Yes</option>
<option value="two" [[!+fi.select1:FormItIsSelected=`no`]]>No</option>
</select>
</p>
<p style="padding: 0 20px 0 20px; font-size: 14px;">
What is your end market?</p>
<select style="width: 90%; left: 20px; position: relative; padding: 5px; color: #878585;" name="select2" value="[[!+fi.select2]]">
<option value="">Select an option...</option>
<option value="one" [[!+fi.select2:FormItIsSelected=`yes`]]>Yes</option>
<option value="two" [[!+fi.select2:FormItIsSelected=`no`]]>No</option>
</select>
</p>
<p style="text-align: center;">
<textarea style="width: 91%; padding: 5px; color: #878585;" name="message" id="message" rows="6" cols="25" placeholder="Message" value="[[!+fi.message]]">[[!+fi.message]]</textarea>
</p>
<p style="text-align: center;">
<span class="error" style="font-size:10px;color:red;float:left;position:relative;left:20px;">[[!+fi.error.message]]</span>
</p>
<br class="clear" />
[[!+formit.recaptcha_html]]
[[!+fi.error.recaptcha]]

<br class="clear" />

<div class="form-buttons">
<p style="text-align: center;">
<input style="font-size: 20px; text-transform: uppercase; color: #fff; background-color: #1f8c37; border: 1px solid; height: 5%; width: 90%;" type="submit" value="Send" />
</p>
</div>
</form>
</div>


----------------------------------------------------------------------------------------------------------------

FOR THE ChemicalDistributorAndSupplierFormTpl

Full Name: [[+fname]] [[+lname]]

Email: [[+email]]

Company Name: [[+company]]

Phone: [[+phone]]

State/Province: [[+province]]

Has you current company purchased from Nexeo Solutions in the past? [[+select1]]

What is your end market? [[+select2]]


Message: [[+message]]


]]>
https://forums.modx.com/thread/103564/formit-what-is-the-error-here#dis-post-557260 Wed, 07 Mar 2018 09:23:26 +0000 https://forums.modx.com/thread/103564/formit-what-is-the-error-here#dis-post-557260
<![CDATA[FormIt Filter Out Spam Words spamwords From Message Field]]> https://forums.modx.com/thread/103516/formit-filter-out-spam-words-spamwords-from-message-field#dis-post-556889
I am a designer/developer and my customers get legitimate companies who try and sell them their services though their website's contact forms especially for SEO, website traffic blah blah blah. Well, I figured there had to be a simple solution to check for words in the message field and either give a false confirmation and not submit the form or, as this solution does, simply do nothing which in most cases will meet my need since they'll probably just move on robot or person alike... (again I am sure someone can improve upon this)

So basically I added a few things together and came up with this custom hook which I hope is helpful to someone else as well.

1. I created a snippet called scumwords (so as to not be confused with badwords for eforms I believe it is)
with the php as seen here:
$message = $hook->getValue('message');
 
if (strpos($message, 'website') !== false) {
    return false;
}elseif (strpos($message, 'traffic') !== false) {
    return false;
}else{
    return true;
}

2. Update the words "traffic" and "website" with your words.
3. Added custom hook name "scumwords" into the hooks field, which I put it after spam, like this:
&hooks=`spam,scumwords,email,FormItSaveForm`


And viola! Those emails get ignored with spammers not really sure what is going on and all other emails go through like normal.

What do yall think?! Again, I hope it helps someone else!
]]>
https://forums.modx.com/thread/103516/formit-filter-out-spam-words-spamwords-from-message-field#dis-post-556889 Fri, 16 Feb 2018 05:54:18 +0000 https://forums.modx.com/thread/103516/formit-filter-out-spam-words-spamwords-from-message-field#dis-post-556889