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

Hidden 4 digit code


  1. druting
    Member

    Hi, i'd like to usee the MachForm for a simple voting mechanism i'm setting up on my website. The idea is to let users enter a name, email address and image and have people vote on their image using SMS.

    For this to work each person who submits an image needs to be assigned a unique 4 digit number, this will then be displayed in the success message.

    Is something like this possible in MachForm without /too/ much tinkering, i know it's not possible out of the box but is it going to be a crazy amount of work to get this to work?

    Posted 15 years ago #
  2. druting
    Member

    I guess an easy way for this to work is set up an auto-increment field in the database that generates the 4 digit code when a submission is made, then grab this field from the database on a custom thanks page, for this to work i'd need to pass the id number of the submission to the thanks page.

    Am i heading in the correct direction here?

    Posted 15 years ago #
  3. yuniar

    There are few ways to do this.

    1) Each of your form table already has auto-increment field, check the id column. If you need unique code, I suppose you can generate three random characters and join the result with the auto-increment column.

    So the result would be something like: SCR1, BSG2,HSG3, JSH4

    2) Add a text field, then edit the CSS and set the display property for this field to "none". That would make it hidden. Then set the default value of this field to be a random characters.

    Are they make sense? I suggest to do number 1 above, I think it's easier.
    Let me know if you are having difficulty.


    MachForm Founder

    Posted 15 years ago #
  4. yuniar


RSS feed for this topic

Reply