default password needed to continue with entries

By: Thomas Kutscher | Asked: 08/30/2023
ForumsCategory: General questionsdefault password needed to continue with entries
Thomas Kutscher asked 11 months ago
Hey there, how can i password protect sections in a form from being filled by entering a given pw in first place? The situation is as follows: It should be a simple user registration form for a training event. There's a small group of participants, all of which are receiving the same password before, so that only they are able to register to the event. Each registered participant should automatically be logged in after submitting the form. The password, entered in the first place, should also be the personal pw for each account. In the end we are able to differ who of the invited persons has finally attended to the (livestream)event. Appreciating any help, thanks :) 
1 Answers
Victor Font answered 11 months ago
If you save a password as the WordPress account password, which is encrypted and unreadable, how will you know the event if you're relying on the password to tell you?
Victor Font replied 11 months ago

What happens when a user changes their password?

Thomas Kutscher replied 11 months ago

<p>Dear Victor, it's actually not the password itself, which tells us how many participants have registered to see the livestream.</p><p>This password should only prevent other visitors (without invitation) of this site, to fill in the registration form. And ideally, to be the pw for each registered account, too.</p><p>It's only to make the registration process as simple as it can be. And protecting the form at the same time.</p><p>Do you think that's possible? thx, tom</p>

Victor Font replied 11 months ago

Several years ago, I built a student enrollment system with Formidable for a major US University's STEM program. As I think about your requirement, if this was building another student enrollment application, I absolutely would not entertain using a WordPress user password as a reliable field for tracking course enrollment, producing reports, or statistical tracking. Instead, I would use a course code unrelated to passwords as a URL parameter.

To register users into WordPress with Formidable, you must use Formidable's User Registration add-on unless you have the development skills to write your own custom integration through Formidable's many available WordPress hooks. But when you have a good add-on that does most of the job for you, as a developer you can focus on the aspects of the build that make your requirements unique. There's no reason to reinvent the wheel.

The add-on integrates Formidable with the WordPress user tables. Formidable provides an easy to use front end for adding people to WordPress; but it does not control the actual password creation or editing. WordPress does. Formidable hands the process over to WordPress when it has collected the data WordPress needs.

This is how using a URL parameter works:

When you send your registration invite, include a query string in the link to your form like this:

https://yourdomain.com/registration-form?code=12345

Then, when the user clicks on the link, it will open your form and pass the "code" to the form as a URL parameter.

When you build your form, include a hidden field and set its default value to [get param=code]. Formidable will do the rest and save 12345 in the hidden field.

Saving the course code in a hidden field will allow you run statistics or use that field as a view filter in the future. If you're course codes repeat periodically, I'd also save course date in the metadata. The more granular your dimensions, the easier to produce reports and trends later on. Whether for a single course code, or course code plus additional metadata, the end result is a unique identifier for every course and every student.

Another tip when dealing with users is to include the Formidable user_id field on your registration form. Once WordPress creates the user, it passes the new user id back to Formidable that will save it in this field.

You also asked about password protecting sections of a form. The answer is no. We have to think of forms as encapsulated objects. A form is a single entity composed by a well defined HTML Document Object Model. Formidable builds high quality industry standard forms. Everything in Formidable that was built by Strategy 11 developers is built to industry standards.

As a community volunteer, I spend a lot of time in Formidable's internals, especially when developing training content and tutorials for Formidable Masterminds. If you haven't visited the Formidable Codex to see what I've built, then please see this article: https://formidable-masterminds.com/about-codex-v2/. I vouch for the high quality code being produced by Strategy 11 developers.

As for password, you can password protect a page or post that has an embedded form, but password protecting form sections is something that's not done in every day practice unless its for some high level security project. And at that, it takes a big budget and engineering to make it work.

What you can do, and what I recommend, is to hide and show sections of the form conditionally. You can use any data on the form to hide/show sections conditionally.

Here are a couple of Formidable KnowledgeBase articles you may find useful.

https://formidableforms.com/knowledgebase/user-registration/

https://formidableforms.com/knowledgebase/using-conditional-logic/

Good luck with your project!

Thomas Kutscher replied 11 months ago

Dear Victor,

thanks so much for your extensive comment. There are some nice ideas that i will consider certainly.
It's always a pleasure and very helpful to share thoughts on special projects with some "masterminds" 🙂

Have good time!

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
crossarrow-right