Jump to content

Generate random code in Formbuilder


neophron
 Share

Recommended Posts

Hi,

I hope, this is the right place for questions about the Formbuilder (I couldn't find in the ProField support a subsection for the Formbuilder).

A client needs for his website a random generator of a code (as winning numbers). This generator should be placed in a simple form (name and email) and a random generated code should be visible there.
This code, or winning number, must be stored in the db together with the name and email. And the participant must receive a confirmation email with this code.

I know, that the Formbuilder can store and send data to the user. But what about a random generated code? Is this a hook job?

I found this module: http://modules.processwire.com/modules/process-field-generator/ but it's not for PW 3. 

Link to comment
Share on other sites

1 hour ago, neophron said:

I couldn't find in the ProField support a subsection for the Formbuilder).

The FB board is here.

1 hour ago, neophron said:

but it's not for PW 3

Often, a module is v3-compatible even though it's not officially marked as such. Try to install it and see if it works. Sometimes all you (maybe) need to add, is PW namespace in the .module file(s).

There's also this module that might do what you want: http://modules.processwire.com/modules/guid-generator/

  • Like 1
Link to comment
Share on other sites

14 hours ago, dragan said:

The FB board is here.

I know this link, but it doesn't exist right now 

Sorry, there is a problem

We could not locate the item you are trying to view.

Error code: 2F176/1

14 hours ago, dragan said:

Often, a module is v3-compatible even though it's not officially marked as such. Try to install it and see if it works. Sometimes all you (maybe) need to add, is PW namespace in the .module file(s).

There's also this module that might do what you want: http://modules.processwire.com/modules/guid-generator/

Thanks, I'll check both modules.

 

Link to comment
Share on other sites

30 minutes ago, neophron said:

I know this link, but it doesn't exist right now 

Well, that error message is unfortunately misleading. It should say something like "This board is only accessible if you have a paid Pro support license". When you buy a Pro module, you have access to the VIP forum for one year. After that, you have to sign up for a support plan (the module itself doesn't have an expiry date, of course), which is something like $25 / year, last time I checked.

Link to comment
Share on other sites

13 minutes ago, dragan said:

Well, that error message is unfortunately misleading. It should say something like "This board is only accessible if you have a paid Pro support license". When you buy a Pro module, you have access to the VIP forum for one year. After that, you have to sign up for a support plan (the module itself doesn't have an expiry date, of course), which is something like $25 / year, last time I checked.

Damn, I totally forgot about! Thanks for the explanation 🙂

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By joe_ma
      Sorry for asking this question here, but I cannot ask it in the VIP section because I use an version of FormBuilder that is expired.
      I have a fairly simple form on a website done with FormBuilder (PW 3.0.148, FormBuilder 0.2.4) that seems to work quite well. I've tested it with Firefox (88.0.1), Chrome, Opera, Edge and it works in all browsers as expected. The form is embedded in the page by pasting the name of the form in the body field.
      Now my customer tells me, that her Firefox (88.0.1) is blocking the page where the form is embedded: "Firefox may not open this page" for safety reasons.
      I have no clue as to what seems to be the problem here, since the form is on the same server and has the same domain.
    • By rooofl
      Hi! I am trying to create a hook that takes the value of a form file field, and add it to an image gallery of an existing page.
      $forms->addHookBefore('FormBuilderProcessor::processInputDone', function($e) { $form = $e->arguments(0); if($form->name == 'new-inuse') { // related_font is a page selector $font = $form->getChildByName('related_font'); // getting the page name $fontName = $font->attr('value')->name; // finds the page from its name $fontPage = wire('pages')->find("name=$fontName"); // in_use_image is a file upload field $image = $form->getChildByName('in_use_image'); // trying to add the image to the existing image gallery in_use field $fontPage->in_use->add('$image'); // error here $fontPage->save(); } }); This outputs the following error: `Call to a member function add() on null`. Any idea what’s wrong with my code?
    • By 999design
      Hi all,
      Running into an odd error that I can't seem to get my head around.
      We have 2 separately created Formbuilder forms sitting on a single page.
      But we keep experiencing weird results with them, originally we couldn't get one of the forms to ever submit so we ended up disabling CSRF for them which let us get around this issue.
      However it then causes a problem in that with CSRF disabled, one of forms always records 2 entries on submission. Just a straight duplicate within the entries for that form.
      So trying to stop this happening we tried enabling CSRF again and although that does stop the duplicated entry, it ends up giving really weird feedback such as the attached screengrab.
      Hazarding a guess I assume whatever is trigger on submission is firing twice because of the presence of the second form, but I have no idea why this would be the case as they are 2 seperately named forms?
      Any ideas?

    • By cosmicsafari
      Hi all,
      I have the same form on multiple pages, the idea being that I can populated a hidden field with a page specific value automatically.
      I figured this should be reasonably straight forward but I can't seem to get the following to take effect.
      <?php echo $forms->embed ('my-form-name', array('hidden_field_name' => '666')); ?> No matter what I do, it never updates the default value currently set for said hidden field.
      Feels like I'm missing something really obvious?
      Any ideas?
    • By benbyf
      I have a a form in my site footer that can be accessed anywhere on site, I've added the form in the _inc.php file and added the render in the pages footer.php. However, this works well on the homepage e.g. you can submit said form and get a thank you on reload, doesnt work at all on other pages... Just lots like a fresh reload. Any thing im doing wrong here or ways to diagnose as there isn't an error log for formbuilder etc...?
×
×
  • Create New...