We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21414
    • 41 Posts
    This is my form it call before my form:

    [[!FormIt?
       &hooks=`nickremhours,redirect`
    &redirectTo=`18`
    &validate=`name:required,date:required,new_hours:required,pto:required,type:required`
    ]]


    "nickremhours" is a custom snippit call,

    this is that snippit:

    <?php
    $path = MODX_CORE_PATH . 'components/tracking/';
    $result = $modx->addPackage('tracking',$path . 'model/','pto_');
    
    // form data
    $hours = $_POST["new_hours"]; 
    $name = $_POST["name"];
     
    // retrieve the object of the row updated
    $object = $modx->getObject('Tracking', $name);  
    // get Total Hours and adjust to new value
    $new_hours = $object->get('total_hours_aclum') + $hours;
    
    $object->set('total_hours_aclum', $new_hours);
    
    $object->save();


    If I run the form without the custom snippit the redirect call works, if I include the snippit it doesn't, however the snippit does succeed in doing what it is supposed to do.

    Any ideas as to what in my snippit could be causing the redirect to not fire?
      • 28215
      • 4,149 Posts
      You're not returning true in the snippet:

      return true;
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 21414
        • 41 Posts
        Wow...

        That was stupidly simple...

        Thank you.