Sterc / FormIt

A dynamic form processing Snippet for MODX Revolution
https://docs.modx.com/current/en/extras/formit
33 stars 58 forks source link

Math Operator Empty After Succesful Submission #27

Closed loxy closed 8 years ago

loxy commented 9 years ago

Hi,

after a successfull form submission with consequent page reload all hidden math fields are empty. See forum for more information: http://forums.modx.com/thread/85683/math-fields-are-empty-after-form-submission

So this is the flow:

It appears in: -MODX 2.2.15 on PHP 5.5 -MODX 2.3.2 on PHP 5.6

Any ideas how to fix it?

Best regards, Kersten

Bumme commented 9 years ago

Could you give me an example FormIt call?

loxy commented 9 years ago
[[!FormIt?
&hooks=`math, email`
...
&mathMinRange=`10`
&mathMaxRange=`100`
&mathField=`fmath`
&validate=`fmath:required, ...
]]

...

<div class="form-group [[!+fi.error.fmath:isnot=``:then=` has-error`]]">
  <label for="fmath" class="col-xs-3 control-label">What is [[!+fi.op1]] [[!+fi.operator:is=`-`:then=`minus`:else=`plus`]] [[!+fi.op2]]?*</label>
  <div class="col-xs-9">
    <input type="text" class="form-control" name="fmath" value="[[!+fi.fmath]]" placeholder="Result" />
    [[!+fi.error.fmath]]
    <input type="hidden" name="op1" value="[[!+fi.op1]]" />
    <input type="hidden" name="op2" value="[[!+fi.op2]]" />
    <input type="hidden" name="operator" value="[[!+fi.operator]]" />
  </div>
</div>
Bumme commented 9 years ago

Your test works here. Did you've add some custom hooks, validators? Could you do a quick test with your own example code?

loxy commented 9 years ago

I checked the latest version 2.2.6. The same problem. No custom hooks or validators...

joeke commented 8 years ago

Hi @loxy I've located and fixed the problem with the empty math operator. The fix will be merged into our next release (2.2.9) which is scheduled for the end of this week.

loxy commented 8 years ago

Nice!