We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21702
    • 10 Posts
    Hello,

    I use eform like that :
    [[eform2db]]
    
    [!eForm? &noemail=`true` &formid=`updateForm` &eFormOnBeforeMailSent=`eform2db` &eFormOnBeforeFormParse=`populate_form` &tpl=`edit_form` &thankyou=`formResult` &debug=`3` !]
    



    The hidden fields in the &tpl=`edit_form` :
    <input name="caseIdForm" type="hidden" value="[+ valueId +]"/>



    i populate the fields of my &tpl=`edit_form` in &eFormOnBeforeFormParse=`populate_form`
    i try many things like :
    $caseId = $_REQUEST["idcase"];
    $modx->setPlaceholder('valueId', $caseId);
    


    $caseId = $_REQUEST["idcase"];
    $fields['caseIdForm'] = $caseId;
    


    $caseId = $_REQUEST["idcase"];
    $templates['tpl']=str_replace('[+ valueId +]', $caseId, $templates['tpl']);
    


    I need to get the hidden input value in &eFormOnBeforeMailSent=`eform2db` to update my DB.

    My problem is that the hidden field is null or [undefined] when i try to get it in my function &eFormOnBeforeMailSent=`eform2db` :
    $caseId =$fields['caseIdForm'];


    But when i change the input type to "text" instead of "hidden", all works...
    I really don’t understand why input type= "text" work and input type="hidden" doesn’t work...

    May someone help me ?
      • 21702
      • 10 Posts
      with &debug=`3`, i can view that :
      "Error in the form"

      <input name="caseIdForm" type="hidden" class="[+caseIdForm_class+]" value="[+caseId+]" />

      ’caseIdForm’ Failed using rule: #VALUE , (input=9)
      ’formid’ passed using rule: #VALUE updateForm, (input=updateForm)

      Fields array:
      array (
      ’caseIdForm’ => ’9’, // That’s my value "9" is good !!!!!
      ’caseIdForm_class’ => ’invalid’,
      ’caseIdForm_vClass’ => ’invalid’,
      ...

      Formats array:
      array (
      ’caseIdForm’ =>
      array (
      0 => ’caseIdForm’,
      1 => ’caseIdForm’,
      2 => ’hidden’,
      3 => 0,
      4 => ’Tentative de falsification du code du formulaire détectée!’,
      5 => ’#VALUE ’,

      ...


      Classes parsed :
      array (
      ’caseIdForm’ => ’invalid’,
      )

      Falsification of the code of the form?!!!? ...
      I think it’s a problem with classes ...
        • 21702
        • 10 Posts
        Hello,

        I didn’t find any solution to this pb huh :’( , i delete the hidden input and make an url post variable to do what i’m looking for... DIY