MODX Community

Formalicious is missing values for radiobuttons. Not showing values, showing title instead

I have Fomalicious installed and FormIt on my clients site. All of a sudden his radio buttons do not list the created values (options), instead just list the title of the option. You can see it here: Website Form under any of the the radio options.

Before I posted, I updated Formalicious to the latest version.

Using:
Modx v2.7.3
FormIt 4.2.5
Formalicious v2.0.4

Any suggestions?

There should be a chunk radiobuttonsItemTpl (maybe radiobuttonsInnerTpl) that controls the output of your radio buttons.

From the documentation:
“All field types have a Chunk associated with them. These can be found in the Elements-tree, below the Formalicious-category. […] You can change these chunks to match your needs. It is recommended to duplicate and rename a field before changing it , because an update of Formalicious will override the original chunks.”

OK I found 2 chunks under Formalicious:

  1. formaliciousFieldRadiobuttonsTpl with this code:


    [[!+title]][[!+required:notempty=*:empty=``]]:

    [[!+values]]
    [[!+error]]

    [[!+description:notempty=<div class="form-control--description">[[!+description]]</div>]]
  2. And this chunk you mention formaliciousFieldSelectItemTpl with this code:

     <label>
     <input type="radio" name="[[!+name]]" id="[[!+name]]_[[!+idx]]" class="form-control form-control--radio [[!+error:notempty=`error`]]" value="[[!+title]]"
         [[!FormItIsChecked? &input=`[[!+value]]` &options=`[[!+title]]`]]
     />    [[!+title]]</label>
    

But I am not sure what to do with this coding? Are you suggesting I renamed the field in the formalicious editor under extras> formalicious> form name> edit> fields tab? Rename each field here, then go to chunks and add the renamed field?

I believe the correct chunk is named formaliciousFieldRadiobuttonsItemTpl.
I would copy the chunk (to not lose the original code) and then change the chunk to meet your needs.

OK I found that chunk named: formaliciousFieldRadiobuttonsItemTpl with this code

    <label>
<input type="radio" name="[[!+name]]" id="[[!+name]]_[[!+idx]]" class="form-control form-control--radio [[!+error:notempty=`error`]]" value="[[!+title]]"
    [[!FormItIsChecked? &input=`[[!+value]]` &options=`[[!+title]]`]]
/>
[[!+title]]

but I am not sure what to update? The &options=[[!+title]]]] should automatically pull in the options I created for this field in the form correct? When I edit each option or create a new option, there is no individual or distinct title for those options, its all built into the form editor. So I am still confused what to do with this chunk when you say, change to meet my needs.

So I checked the link to your form you posted and now I’m confused too.
I think [[!+title]] and [[!+name]] are mixed up. If you use

<label>
    <input type="radio" name="[[!+title]]" id="[[!+title]]_[[!+idx]]" class="form-control form-control--radio [[!+error:notempty=`error`]]" value="[[!+name]]"
        [[!FormItIsChecked? &input=`[[!+value]]` &options=`[[!+name]]`]]
    />
    [[!+name]]
</label>

does that work?

Yep! That was the solution! I modified that chunk coding to match your last post. Thank you so much for helping me with this, I was totally in the dark and would have never figured this out!!

I’m not sure this is a solution. I think it produces “name” and “id” values that are not valid.

Can you even submit the form or does it just look ok now? I think the placeholders have all different names now.
Have you created a new form as a test? Does it work with this new chunk too?

I installed the newest version of Formalicious to test it and it worked for me ok out of the box. Something on your installation got mangled (maybe on the update?).

It is probably better to leave the chunk as it was and try to create your forms new!

What snippet do you use to output the form?
[[!renderForm]]?

On my new installation the snippet renderForm doesn’t exist anymore and I had to use [[!FormaliciousRenderForm]]
Does it work if you change the snippet?

The form does not submit, nor send an e-mail to my client. It doesn’t redirect like it should. The coding I have on my page to show the form is: [[$form]]

Snipped: FormaliciousRenderForm has this coding

<?php

/**

$instance = $modx->getService(‘FormaliciousSnippetRenderForm’, ‘FormaliciousSnippetRenderForm’, $modx->getOption(‘formalicious.core_path’, null, $modx->getOption(‘core_path’) . ‘components/formalicious/’) . ‘model/formalicious/snippets/’);

if ($instance instanceof FormaliciousSnippetRenderForm) {
return $instance->run($scriptProperties);
}

return ‘’;

Let me try your suggestions, Creating new forms kind of sucks because I have 2 forms and new values. But I am now thinking it is what i have to do. Am wondering if I need to reinstall, but don’t want to loose my information.

Maybe create a backup first. The information for the forms should be in all the database-tables starting with modx_formalicious.

As a side note: This is the corresponding chunk from the version 1.2.1. As you can see, everything looked completely different. There was even a placeholder [[!+fieldname]] that isn’t in the chunk anymore.

<div class="radio">
    <input type="radio" name="[[!+fieldname]]" value="[[!+name]]" id="[[!+fieldname]][[!+idx]]" class="frm-radio"
           [[!FormItIsChecked?&input=`[[!+curval:default=`[[!+fi.[[!+fieldname]]]]`]]`&options=`[[!+name]]`]]
    />
    <label for="[[!+fieldname]][[!+idx]]">[[!+name]]</label>
</div>

As this seems to be a problem with updating Formalicious from version 1 to version 2, I found the following statement in the documentation:

Updating to v2

Updating is only possible from the v1.4.4 version but still needs you to refactor some fields & tpls. The new snippet & placeholder names can be found in the instructions.

I mostly have the issue resolved. I completely removed the previous version of formalicious and even removed the tables in my database. Started over from scratch, had to go to mod more and install their package so I could then install formalicious. Its just not available in the the downloads of MODx site. This time I installed v1.4.3 as I know that upgrading to v2.?? is what messed it up last time with my installation (plus v2 was not available yet in my installation).

Got it all working except a third party recapatcha addition, but am very close. For those following be very careful upgrading from v1.4.3 toi v2.??, did not go well for me. Maybe you will have better luck, but you had better back up first just in case the plugin does not properly upgrade on all sites. Thank you halftrainedharry for all your help!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.