We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12379
    • 460 Posts
    Some eform values in this form aren't appearing in an eform-generated email while others are:

      <input type="text" size="2" name="qty_item_5" id="qty_item_5" value="0"/>
       <label>Corsage $18</label><br />
       <input type="checkbox" name="item_5[]" value="white/ivory/cream" />
       <label>white/ivory/cream</label>
       <input type="checkbox" name="item_5[]" value="pink/cream " />
       <label>pink/cream</label>
       <input type="checkbox" name="item_5[]" value="red" />
       <label>red</label>
       <input type="hidden" name="price_item_5" id="price_item_5" value="18" />
       <input type="hidden" name="name_item_5" id="name_item_5" value="Garden Roses Corsage" />
       <span id="total_item_5"></span>
      </p>
      <label>Subtotal: $</label>
      <input type="text" name="subTotal" id="subTotal" value="" size="8" readonly="readonly" />
      <input type="hidden" name="Msg" value="" />


    Template chunk (sample) for the email:

    <p>Order<br />
    =====================================================================<br />
    [+qty_item_5+] x [+name_item_5+] [+item_5+] - [+price_item_5+]<br />
    <p>Subtotal: [+subTotal+]<br />


    The information missing is:

    item_5 (checkboxes)
    price_item_5 (hidden field)
    subTotal (jquery generated and correctly displays on screen in input field ie qty_item5 * price_item_5)

    So only "qty_item_5" (input), "name_item_5" (hidden field) are appearing in the email.

    :/
      Mostly harmless.
      • 12379
      • 460 Posts
      Not in this part of the form as I have a snippet doing advanced validation:

      ie
      [!r2g_checkReqFields!]
      [[validateEFormDate]]
      [!eForm? &eFormOnValidate=`reqFields` &tpl=`sample_form` &report=`r2g_order_report` &sendAsHtml=`1...etc!]
      `

      <?php
      function reqFields(&$fields, &$vMsg, &$rMsg, &$rClass) { //<-- $rClass holds assoc. array of class names for fields (for eForm > 1.4.4)
      	global $modx;
      
      		/* optional. load parameter values for error css classes */
      		$req_class_name = $modx->event->params['requiredClass'];
      		$inv_class_name = $modx->event->params['invalidClass'];
      		/* end optional */
      		if ($fields['qty_item_5'] > 0){
      			
      			if (empty($fields['item_5'])){
      				$rMsg['item_5'] = 'choose flower colour for item 5';  //<-- should be the field name or description only
      				$rClass['item_5'] .= $rClass['item_5'] ? ' ' . $req_class_name : $req_class_name; //optional.
      			}
      		}
      
      		if (!empty($fields['item_5'])){
      			
      			if  (empty($fields['qty_item_5'])){
      				$rMsg['qty_item_5'] = 'choose quantity for item 5';  //<-- should be the field name or description only
      				$rClass['qty_item_5'] .= $rClass['qty_item_5'] ? ' ' . $req_class_name : $req_class_name; //optional.
      			}
      }
      //etc, etc
      
      [ed. note: hotdiggity last edited this post 11 years, 5 months ago.]
        Mostly harmless.
      • Do the fields in your form have the eform attribute? In the case of radio, checkbox or select fields only the first in the group needs to have the eform attribute.

        http://rtfm.modx.com/display/ADDON/eForm#eForm-Hiddenfields%2Cselectboxes%2Cradiooptionsandcheckboxfields

          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
        • You might want to try it anyway.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 12379
            • 460 Posts
            Uh, I remember now this tripped me up a few years back. Best not to use "item" to prefix a variable when using eform.

            :/ [ed. note: hotdiggity last edited this post 11 years, 5 months ago.]
              Mostly harmless.