AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

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

8 Posts
3 Users
1 Reactions
1,101 Views
Posts: 5
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@hybridelectric-forum)
Active Member
Joined: 2 years ago
[#50589]

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

1

7 Replies
Robert
Posts: 10741
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months 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
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@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.

 2

Posts: 5
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@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: 6 years ago

Famed Member
Posts: 2600
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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


(@hybridelectric-forum)
Joined: 2 years ago

Active Member
Posts: 5
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@dimalifragis This is plugin or what?


dimalifragis
Posts: 2600
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@dimalifragis)
Famed Member
Joined: 6 years ago

No, in the editor bar

 

 Screenshot

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

Active Member
Posts: 5
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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>

Share: