Notifications
Clear all

Limited Support

Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.

 

[Closed] I need help with - User registration with code

8 Posts
3 Users
1 Reactions
897 Views
Posts: 5
Topic starter
(@hybridelectric-forum)
Active Member
Joined: 2 years ago

I would like to add to the registration form a field where the user will be able to enter the CODE/PIN. Previously given by me, in an email or on a business card attached to the previously purchased product. I would like to create a closed forum and for that I need to register with a Code, how to do it so that such a field appears and registers only people who provide a PIN for example 12345.

 

It is important that the code for the user is chosen by me, it can be 1 code, but it would be best if there could be many of them. Maybe there is some plugin that works well with WPForo.

Please help me

7 Replies
Robert
Posts: 10616
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi @hybridelectric-forum,

You can use wpForo User Custom Fields addon to add new fields in the registration, user profile and account pages.

Posts: 5
Topic starter
(@hybridelectric-forum)
Active Member
Joined: 2 years ago

I have already added the addon, but I don't know what field to add so that the Pin code has a set value/values.

Posts: 5
Topic starter
(@hybridelectric-forum)
Active Member
Joined: 2 years ago

<script> function validatePIN() { var enteredPIN = document.getElementById('pin').value; var allowedPINs = ['1234', '5678', '9876']; // Lista akceptowanych kodów PIN if (allowedPINs.includes(enteredPIN)) { alert('Poprawny kod PIN. Możesz się zarejestrować!'); } else { alert('Nieprawidłowy kod PIN. Spróbuj ponownie.'); } } </script>

 

I added this code to the HTML button, but it still doesn't work. Is there an option to change specific plugin files to add such a field?

2 Replies
dimalifragis
(@dimalifragis)
Joined: 5 years ago

Famed Member
Posts: 2601

@hybridelectric-forum Can you please use the CODE (<>) when posting code snipnets?

(@hybridelectric-forum)
Joined: 2 years ago

Active Member
Posts: 5

@dimalifragis This is plugin or what?

dimalifragis
Posts: 2601
(@dimalifragis)
Famed Member
Joined: 5 years ago

No, in the editor bar

 

1 Reply
(@hybridelectric-forum)
Joined: 2 years ago

Active Member
Posts: 5

@dimalifragis

<script> 
function validatePIN() { 

var enteredPIN = document.getElementById('pin').value;
var allowedPINs = ['1234', '5678', '9876']; // Lista akceptowanych kodów PIN 

if (allowedPINs.includes(enteredPIN)) { 
alert('Poprawny kod PIN. Możesz się zarejestrować!'); 
} 
else 
{ 
alert('Nieprawidłowy kod PIN. Spróbuj ponownie.'); 
} 
} 
</script>