Access Code To Continue

By: Jeff Dick | Asked: 02/02/2024
ForumsCategory: Code HelpAccess Code To Continue
Jeff DickJeff Dick asked 2 months ago
How would I create an access code mid way through a form that would require a unique passcode to continue after a page break?   Example:  Enter Code To Continue: [[text field]] It will not let users continue until an exact code is entered.  Basically like a password, but only used internally in the form as a gate.   I have tried to think of a way to do this with conditional logic, but with page break, it doesn't let you hide the button until a specific criteria is met (like it does on the submit button) so I am trying to think of a work around here. Any thoughts or ideas would be greatly appreciated.  Thank you! 
Victor Font replied 2 months ago

Yes. This can be done. It's very likely a bespoke solution, but first I need to understand a few things and alert you some potential challenges.

1. How many page is the multi-page form?
2. On what page is the "button"? We'll call it that for now while the solution is undefined.
3. If the button is not on the final page, do you want the "hiding" feature to function only on the current page or the current plus all subsequent pages?
4. Are you using a root line on the multi-page form? See, question #3.

Depending on how you want this to work, it's going to require custom PHP, jQuery, or both to make this work. I don't know which hooks you need to use without researching either. You request is unique. I haven't seen a request like yours in over a decade answering Formidable questions online. This might be a little difficult to explain how to do if you're a DYIer. I'll do what I can to point you in the right direction, but I do not have the time to research this as a volunteer. I'm too busy creating content for Formidable Masterminds. Your solution, however, may lie in an actual consultation with a developer.

Jeff DickJeff Dick replied 2 months ago

Thank you so much Victor for the prompt and thorough reply. Wow. I never thought something which sounds super simple would end up being so complex. I will give you some context on the project to shed some light on what I am trying to do and it should all make sense.

I am building a form to guide a guest through an escape room. Go here, do this, input the "code". (correct answer to the puzzle) Upon getting the correct code, you can advance to the next step. These are all going to be very simple inputs which would either be alphanumeric text or possibly a date field.

If the page break conditional logic allowed show / hide based off the = function (like the submit button does) this would be super easy to do. Sadly, it does not.

Answers to your questions:

This form is many, many pages. Currently 27 and I am about 3/4 of the way through, so it will be over 40 pages by the time I am done.

Ideally if I figure out how to make this work, it will appear on around 11 or so of the different pages.

No root line as I am using a lot of logic that bounces people to different pages and skips pages based off their answer inputs.

I am even now trying of a way to "fake it" and still make it behave semi correctly. This doesn't have to be bullet-proof security, it's just a fun, escape room game for a non-profit I am helping out. I took the question here to see if anyone else could think of some creative work around to get a similar behavior on a form without going down the custom dev route.

If I do have to do custom dev route, are there any developers you would recommend for this?

Thank you again, I really appreciate it!

Victor Font replied 2 months ago

You have an interesting project! An escape room? That's fun.

There may be a few ways of doing this, but I'm not convinced a 40-page form is the best way to do it because when you said, "using a lot of logic that bounces people to different pages and skips pages based off their answer inputs", it suggests randomness.

When you have a multi-page form, Formidable loads all of the form's fields regardless of the page your on. Only the current page's fields are visible because every other field has been converted to a hidden field, regardless of the way they appear on the active page.

You could create jQuery that can manipulate the "jumping around" based on rules that trigger Formidable's Ajax events so the server can handle the next display.

You could also use embedded forms instead of one giant form. What are you planning for the data. So far you've only mentioned user input. What are you doing with the data the are entering. Are you saving it?

What happens when the game is over? What does the user see?

How are they going to be answering the questions? Are you giving them handheld devices? Is there a terminal in the escape room? It could be fun to record and play back a video of them solving the puzzle. You show them on their terminal and sell it to them if they want to keep it.

There's a lot more behind software engineering than building a form and then trying to make the form fit a business process, if the business process is not fully defined. You need to map out the business process first, try to anticipate user responses in the equation, and build the functionality to custom fit the business process while making it all easy and entertaining to your target demographic.

This really is a fun project. I don't take clients on regularly anymore unless it's for consulting on or staffing an enterprise project. I own Formidable Masterminds. Our Developers Directory has the best Formidable developers in the world. You may recognize many of their names because they are the same people that volunteer their time to answer questions in almost all of the Formidable groups out in the wild. Here's the link to the Developers Directory.

Victor Font replied 2 months ago

Here's one last thought about randomness vs. the appearance of randomness. Have you tried the Quiz add-on? It handles randomness really well, even randomly scrambling radio button and checkbox values. So, with Formidable, true randomness is possible. You have to be careful how you phrase your answers. For example, don't say "all of the above" or "none of the above" if you're scrambling answer. Use phrases like "All of these" or "none of these". The wording can be tricky.

Appearance of randomness is rules based randomness. Your project is perfect for a rules base. Jumping from point to point based on logic is navigation rules. Navigation rules are the game's logic. If constructed correctly, you can make the rules a configuration item that you can change on demand without rewriting the underlying code. Each rule is an entry in a configuration table.

Once you have a configuration table built, you can theoretically have different rules bases for different games, without changing one line of code that makes it all work.

This is an advanced approach and one that I use for my own projects, but getting code to this level of proficiency would be an expensive project to implement.

Jeff DickJeff Dick replied 2 months ago

Hello again Victor and thank you very much for the detailed replies as always. Great thinking and questions for sure and I will be happy to provide some additional context.

Logic bouncing: I would say I am bouncing "all over" so sorry for saying that first. The story plot is built where It has logic which has them skip next page if they answer A, but not if B. This is to provide more in-depth story paths based on the users selections. I started building the form like this, then realized it is actually far easier to have all options appear on the subsequent page and just use show / hide to show the content I wanted to display. The second half is built out like this. I may go back and change the page skip logic if I have time.

Overall Goal: This is a mobile escape room that will be used for a trade show. Set it up, run it for a few days and then break it down and move it to the next show. Users will be using their cell phones to "guide them through" the experience and provide them backstory on what they are to be doing. I chose Formidable to write this piece of software as I knew it fairly well and now after doing this project, know it much, much better. 🙂

The idea of monetizing it is fun and clever. Very amazing thought, but I don't think it would fit in the current application of this game. Seeing this is a trade show booth, it doesn't even have a "pay to play" component to it. It's just something fun to do.

Speaking of that, the idea behind the form is actually lead collect. The data inputs itself from the game go no where and just lead them through the game. At the beginning, I ask for their name, email, phone number, company. I am harvesting that data, but the game inputs really don't matter as far as collection goes.

Coming back to this access code question, there are a few parts in the game where I want users to solve a puzzle and type in the correct answer to continue. It is crazy that something that sounds so simple to create is actually very complex on the backend. I am still trying to find a simple hack and thought I had one until I realized if you make a field "read only" it doesn't take the required logic into account when gating them from going to the next step. My logic was:

- Create a "required" radio button with one choice, place it below answer text field.
- Make it read only so guests cannot just click it
- Make it vanish with conditional logic should they type in the correct answer below.

See where I am going here with this? It was all great until I make it read only, now it just let's them jump to the next page with no input. Back to the drawing board. I am going to reach out to actual Formidable and see if they have any ideas as well.

My other thoughts is to "fake it" by using conditional formatting HTML blocks that say "incorrect answer" and then have it switch to "success!" when they put it in correctly, however, if they press continue either way, they will keep moving through the game. Not idea but a cheap hack to make it seem like it is doing what I want it to do.

I poked around Formidable Masterminds last night. Wow! Impressive. The more I learn about this program, the more I learn there is SO SO much it can do. Truly fantastic.

I hope the above answers give you a bit more insight as to what I am creating and why I need the gate feature. Have an awesome Sunday and talk soon! 🙂

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community