× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to update form data but getting an extra row
#1
Hi,

I'm trying to use the update function with the forms with the following code. I get the data in the form fine but when I go to save it I get a new row in the table and the original remains the same. Any ideas what I have done wrong?

Code:
<?php
require_once 'init.php';
require_once $abs_us_root.$us_url_root.'users/includes/header.php';
require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';
if(!empty($_POST)){
$response = preProcessForm();
if($response['form_valid'] == true){
//do something here after the form has been validated
$response['fields']['user_id']=$user->data()->id;
$response = postProcessForm($response);
}
}
?>

<?php if (!securePage($_SERVER['PHP_SELF'])){die();} ?>
<?php
?>
<div id="page-wrapper">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                    <?php
                    $usFormUpdate = 6; //The row you want to update
                    $options['update'] = $usFormUpdate;
                    //then call your form with
                    displayform('session',['update'=>6]);
                         ?><p></p>
            </div> <!-- /.col -->
        </div> <!-- /.row -->
    </div> <!-- /.container -->
</div> <!-- /.wrapper -->


    <!-- footers -->
<?php require_once $abs_us_root.$us_url_root.'users/includes/page_footer.php'; // the final html footer copyright row + the external js calls ?>

<!-- Place any per-page javascript here -->

<?php require_once $abs_us_root.$us_url_root.'users/includes/html_footer.php'; // currently just the closing /body and /html ?>
  Reply
#2
I'm out of town at the moment. I'm going to be doing a lot of work on the form builder. I will try to replicate your situation,if not. I may ask you to send me your form files and I should be able to get to it in a few days.  Sorry for the delay. It's a long trip from china.
  Reply
#3
(11-23-2018, 12:22 AM)mudmin Wrote: I'm out of town at the moment. I'm going to be doing a lot of work on the form builder. I will try to replicate your situation,if not. I may ask you to send me your form files and I should be able to get to it in a few days.  Sorry for the delay. It's a long trip from china.

Sorry only just got my laptop back from repair. Happy to send anything you want/need.
  Reply
#4
I'm also having this issue, but assumed it was just my scripting as this is all a little new.
  Reply
#5
Can you share your script?
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)