PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Two Issues: Editing Entries & Number Fields

  1. Came across two issues recently with a form I'm using. I have 10 conditional fields that display based on the number selected from a drop down menu. If the user selects three, then three of the conditional fields are displayed. The conditional fields are date fields using the Date Field input type, not date picker.

    Here's the problem. In the entries list if you view an entry with empty fields hidden, it initially works great. If the user selected 1 from the drop down menu and only filled out one date field, only that field is displayed. HOWEVER, if you edit that entry, after editing all of the unused date fields are displayed with "array ()" as the value. I haven't gone into the code yet to do a fix, but the issue is that the date field array needs to be checked to see if it is empty and if so, not entered into the dbase.

    Problem number two. I have another field that is only for admin use, called "Amount Paid." I had assigned a default value of zero, using a number field. The idea was that people could fill out the form and submit payment. When payment was received, an admin could go in and update that field. The issue here is that if the amount is 0 (zero) the field doesn't display or record that value in the dbase. If you manually edit the record and enter 0, nothing. If you use 0.00, works like you'd expect. Again, haven't gone into the code to correct this yet.

    If these aren't bugs and I'm missing something, let me know, otherwise, FYI for the next revision.

    Cheers.

    Posted 14 years ago on Thursday March 11, 2010 | Permalink
  2. Here's the answer to the first part -- the issue with empty date fields. It's submitting an array with three empty values -- array(1=>, 2=>, 3=>) -- hence the record in the dbase.

    The hack to fix it is to open forms_model.php and after line 915
    $value = $_POST[$input_name];

    add

    //my empty date field correction here
    if($field['type']=='date' && empty($value['0'])){
    $value = self::get_default_value($field, $input_id);
    }

    Posted 14 years ago on Thursday March 11, 2010 | Permalink
  3. Thanks! We will look at both of these issues for the next release.

    Posted 14 years ago on Thursday March 11, 2010 | Permalink
  4. newport,
    Thanks for taking the time to debug these issues. We will take care of them in the next release.

    Posted 14 years ago on Thursday March 11, 2010 | Permalink