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

Unique Alpha Numeric Form ID for Customers


  1. Rotexy
    Member

    Hello All,

    I am a graphic designer (you can visit my new pet project at www.tinkaroni.com - it is still under construction). I am planing on running a promo for the site launch and would like the form to be able to generate a unique code for each form filled and sent in for the promo. This could also be used to gnerate a unique customer ID.

    Kindly advice on how to do this.

    Thanks

    Rotexy

    Posted 15 years ago #
  2. redityo

    Hi,

    Basically machform already has a unique ID for each entry in form submission. You can see the ID from "entries" menu on "#" column.

    I think you can use that one, or do you have another requirement for the ID ?


    MachForm Support

    Posted 15 years ago #
  3. Rotexy
    Member

    Hi Redityo,

    Thanks for the prompt response, yes I would like numbers generated to have sequence like MON061009N0003 where the first three letters represent the day(MON) date(06) month(09) and form number (0003).

    How secured is Machform on my site in terms of email harvesting by bots etc.

    Regards
    Rotexy

    Posted 15 years ago #
  4. Saghalie
    Pro Member

    {entry_no}-{date_created} (or vise-versa)in the subject line is the best you are going to do without customizing the code. You could even put in the IP number if you wanted.

    Hope this helps.

    Regards,

    Saghalie
    http://www.kcmhosting.com

    Posted 15 years ago #
  5. redityo

    Hi Rotexy,

    If you need that ID stored in machform database, you need to edit some files indeed, and I think you can get that format. To do so try to follow these steps :

    1. Add a "text" field into your form (I assume this field ID is 1)
    2. Add these CSS code to your CSS form to hide that field

    #li_1 {
    display:none !important;
    }

    3. Edit your "includes/post-functions.php" file and go to around line 155, you'll see these code :

    if('text' == $element_type){ //Single Line Text

    then put these code, exactly bellow that line

    if ($form_id == 32 && $element_id == 1) {
    	$generate_id = strtoupper (date("Ddm")) . str_pad($form_id,4, "0", STR_PAD_LEFT);
    	$element_data = $generate_id;
    }

    4. Go to line 1024 in the same file and you'll see this

    $record_insert_id = mysql_insert_id();

    put these code bellow that line

    //update the formated id to get unique ID
    if ($form_id == 32) {
    	$query = "UPDATE <code>ap_form_{$form_id}</code> set <code>element_1</code> = '".$generate_id.$record_insert_id ."' WHERE id='{$record_insert_id}';";
    	do_query($query);
    }

    Don't forget to change form_id and element_id with yours.


    MachForm Support

    Posted 15 years ago #
  6. Rotexy
    Member

    Hi Redityo

    Thanks for the tip. I am not a programmer I am graphics designer (my website was created using Xara Web Designer), so I really can not make sense of all the tips above, but I am quick learner, so I will really appreciate some guidance. Where do i get this file you are referring to, Is the editing done in the online form management system? Kindly Advice. Thanks.

    For the records your form system is the best I have ever used, I actually paid for "Coffee Cups Form Builder" but I latter discovered it had a lot limitations eg. forms refusing to appear on some browsers. But then I came across MachForm without knowing any thing about programming I was in just a few hours able to design web based forms that works across all browser. Please keep up the good work. When are we getting a multi tab form design tool (drag and drop) without programming?

    Regards
    Rotexy

    Posted 15 years ago #
  7. redityo

    Hi,

    You can find the "post-functions.php" file in your machform "include" folder. You can use your file manager or FTP client to get the file.


    MachForm Support

    Posted 15 years ago #
  8. Rotexy
    Member

    Hi Redityo,

    I have updated all the fields and the form now creates the required field but there is no code being generated the field where the unique number is blank. The question is what do I need to do to generate my required unique alpha numeric code?

    Posted 15 years ago #
  9. redityo

    Have you change the form id from my code? you need to adjust the form id with yours. Anyway if the problem still persist, please send your "post-functions.php" file and your form url to :

    customer.service[at]appnitro.com

    I will help you


    MachForm Support

    Posted 15 years ago #
  10. tmparisi
    Member

    Will this work in V3.1?

    Posted 12 years ago #
  11. carlosalvidrez
    Member

    Also wondering if there is an updated version of this technique for the latest version (3.5? as of June 2013).
    Cheers!

    Posted 11 years ago #
  12. sgtsob
    Member

    Has anything changed regarding this request? I would like to add a unique ID to my forms also (year - ####) 14-0001 for example.

    Posted 10 years ago #
  13. yuniar

    What is your machform version? As of version 3, you can use the template variables for this


    MachForm Founder

    Posted 10 years ago #

RSS feed for this topic

Reply