Appnitro Software Forums » MachForm

Unique Alpha Numeric Form ID for Customers

(9 posts)

  1. 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 2 years ago #
  2. 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 ?

    Posted 2 years ago #
  3. 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 2 years ago #
  4. {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 2 years ago #
  5. 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.

    Posted 2 years ago #
  6. 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 2 years ago #
  7. 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.

    Posted 2 years ago #
  8. 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 2 years ago #
  9. 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

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.