<![CDATA[ Formz Builder Questions? - MODX Community Forums]]> https://forums.modx.com/thread/?thread=87783 <![CDATA[Re: Formz Builder Questions?]]> https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-561474 jonahnaylor Sep 11, 2018, 11:51 AM https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-561474 <![CDATA[Re: Formz Builder Questions?]]> https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-526029
Step 1: Create form in Formz Builder Component.
Step 2: Add fields.
Step 3: Save form and close.
Step 4: Reopen form to edit.
Step 5: (Here's where the bug occurs) Add new fields.

On completion of the creation of a new field, the field is added into position 2 rather than at the end of the current list of fields. This happens regardless of any custom sorting of rows.

Has anyone else come across this? How do I make sure that the fields are added to the end of the field list?

EDIT: I submitted a bug report on github: https://github.com/Adido/formz/issues/18]]>
moniarde May 26, 2015, 09:07 PM https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-526029
<![CDATA[Re: Formz Builder Questions?]]> https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-525312
More specifically, I want to know if it's possible to use classes instead of ids in the input tags so that
<input type="text" name="field1" id="field1" value="" class="text " size="40">

would become
<input type="text" name="field1" value="" class="text field1" size="40">

localhot May 08, 2015, 09:41 AM https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-525312
<![CDATA[Re: Formz Builder Questions?]]> https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-498747
Is there a way to send form data to external db?
I created a custom db in modx, and package with CMPGenerator (http://rtfm.modx.com/extras/revo/cmpgenerator) and tried various way with hook to send write data in db, without success :-/

I added formit2db in Formz Builder > Ectra tab > Hooks : formit2db
- tried by passing param via a custom formit chunk
- tried with formit2db and a custom formzHookDBtest in "Hooks" field (formzHookDBtest)

It would be really great to add a Save in "custom database" (General > Method) option...

Another way would be to write a hook in order to do the job but I not really ready do do that.. -- I can write data in some custom db, but I didn't find a way to get form data from Formz field by field with this hook :

 * try formz > custom db
$output = '';// this is what the snippet will return
// add package so xpdo can be used:
$package_path = $modx->getOption('core_path').'components/mytest/model/';
// see the scheme file and the xml model element and you will see the attribute package and that must match here
$modx->addPackage('mytest', $package_path);

// lets add some data!
// see the scheme file and the xml object element and you will see the attribute class and that must match here
// the class name is taken from table names without the prefixed, and is capitalized.
$myRow = $modx->newObject('Test');

$name = 'oki'; //how to get 'name' field this from Formz ?
$description = $hook->getValue('name'); //how to get 'description' field this from Formz ?

echo $description;

$data = array(
        'name' => $name,
        'description' => $description

if ( !$myRow->save() ) {
    $output .= '<p>Could not create row</p>';
} else {
    $output .= '<p>Created row successfully</p>';

Your help will be welcome for these lines:
$name = 'oki'; //how to get 'name' field value this from Formz ?
$description = $hook->getValue('name'); //how to get 'description' field this from Formz ?

johnxx May 27, 2014, 11:23 AM https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-498747
<![CDATA[Re: Formz Builder Questions?]]> https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-483388 http://forums.modx.com/thread/?thread=79567

You add the pipe: Otion 1||Option 2||Option 3

Alright 1 down a few more to go.]]>
wbbuilder Nov 18, 2013, 11:35 PM https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-483388
<![CDATA[Formz Builder Questions?]]> https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-483354
I have a few questions pertaining to Formz Builder that documentation does not address, and was hoping someone has already had these same questions and found a solution. Even if you only know one of these questions, please help with that one question, it would be much appreciated.

1. First, I was wondering if anyone had figured out how to disable the form submission post to the database (database storage)? Meaning just have it sent via e-mail instead of saving to database? In the formTPL chunk I tried chaning this line: &store=`1` to &store=`0` thinking this was adding the data to the database but it did not seem to work. Don't need my client to have to constantly come in here and clean up all their former e-mails (there will be 5 forms with lots of submissions). An e-mail send is sufficient if possible.

2. Also in the formTPL chunck I see this line: &storeTime=`900`. Is this 900 seconds, minutes, or days? And does the form being stored disappear on it's own after this time has elapsed?

3. I am confused as to how to format the: Form Field Type: Radio and Select options. I am only getting 1 option with all my options comma separated. For example lets say I want multiple select drop downs with Option 1, Option 2, and Option 3. I do not know how to format. If I enter this: Option1, Option2, Option 3 in the "Values" field, I get 1 drop-down with all these variables, instead of multple drop-downs. Same thing with the Radio buttons only 1 is created instead of multiples. Can anyone help me here?

4. ReCAPTCHA: I was able to add a reCAPTCHA to my forms and it almost works properly. I almost used the same method I use to display my FormIt reCAPTCHA. The problem is the form can be submitted (added to database and send an e-mail) even before the reCAPTCHA is filled out properly. Have you found the proper solution to display reCAPTCHA using formz builder?

On the front end the submission message or redirect will not work until the reCAPTCHA is fille out, so it appears its working properly. This is an issue because SPAM bots can still send the e-mails (and save to database) even if reCAPTCHA is not yet completed.

Here is what I have done to show my reCAPTCHA:
in my formTL chunck I changed this:
<span class="error">[[!+fi.successMessage]]

<form class="form [[+identifier]]" action="" method="post">
        <div class="actions">
                <input type="submit" name="submit[[+id]]" value="[[+action_button:default=`Submit`]]" class="btn primary" />

to this (added a few lines):
<span class="error">[[!+fi.successMessage]]

<form class="form [[+identifier]]" action="" method="post">
        <br class="clear" />
	[[!+formit.recaptcha_html]] [[!+fi.error.recaptcha]]
	<br />
        <div class="actions">
                <input type="submit" name="submit[[+id]]" value="[[+action_button:default=`Submit`]]" class="btn primary" />

Then in my form extra fields I have added these hooks: recaptcha,spam

I would love for the reCAPTCHA error fields to display, before it allows the submit button to save to database and/or send to e-mail, but am not sure how to do this. This would allow the reCAPTCHA to stop SPAM bots.

In you have figured out any of these questions, your input and feedback would be much appreciated. I am just stuck on a few of theese issues (especially the select and radio button format).]]>
wbbuilder Nov 18, 2013, 04:41 PM https://forums.modx.com/thread/87783/formz-builder-questions#dis-post-483354