This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Prepopulate field (case number or client number) with field from database


  1. grimdesigns
    Member

    Hi I was wondering if anyone new how to prepolate a field on the form from the database and not have this editable on the form view (not admin view). Basically when a new person is filling out the form, it is considered a new case and I want the form to prepopulate the case number field (actually I wont have this visible to the regular form, just the admin). Ideally, I would like to have the new number to be a combination of the form id (example 01) and the entry id (form example (13) so the end result would be 01_13

    If anyone can chime in, that would be a huge help.
    Thanks

    Posted 14 years ago #
  2. yuniar

    Is this case number field need to be displayed within the email or the admin panel?
    If you only need this case number within the email, it's quite easy.

    Simply edit your email content template and use this code:

    {form_id}_{entry_id}

    That would generate the case number field as you need it.

    However, if you need this number displayed within the admin panel. More adjustment will be needed.
    First you will need to add a "Single Line Text" field into your form, which would hold this case number.

    We can then hide this field from the user by modifying the CSS and set the property of this field to hidden.

    Then some modification to your "includes/post-functions.php" will be needed to add the custom code to generate the case number.

    If you could create the form and add that field, please let me know the URL.
    I can help you with the complete code for this.

    You can post it here or send it via email: customer.service [at] appnitro.com


    MachForm Founder

    Posted 14 years ago #
  3. grimdesigns
    Member

    Hi Yuniar, I have sent you the email. Your help is much appreciated.
    Thanks

    Posted 14 years ago #

RSS feed for this topic

Reply