Home › Forums › Quform WordPress › Member Registration Form – Dynamic Member ID and Validating email
- This topic has 15 replies, 2 voices, and was last updated 5 years, 1 month ago by Ally.
- AuthorPosts
- January 30, 2019 at 3:52 am #28364harishParticipant
HI,
We have been using your plugin for the third or fourth time now. Thanks for all the efforts.
This time, we are trying to setup a simple registration form with name, date of birth, email and phone.
We don’t want the user to signup using the same email again. How can we validate that the email is not already in the database before the user submits the form? how can we use these emails and integrate them with wordpress/buddypress users later?
We also want to give a member ID to each user at the time of signup. something like “kr000000001” or something like date-of-birth plus 4 numbers such as “12011990-0001”
We tried going through the documentation https://support.themecatcher.net/quform-wordpress-v2/faq/elements/how-do-i-set-a-field-default-value
but couldn’t find any on this regardPlease help us out.
Thanks,January 31, 2019 at 6:09 pm #28385AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 31, 2019 at 8:45 pm #28391harishParticipantThank you for the links.
I would like to assign a custom member ID to each user at the time of signup. Something like “kr000000001” or something like date-of-birth plus 4 numbers such as “12011990-0001”
Thank you for sharing the link but none of it talks about dynamically adding the member ID like kr0000001 for first user who signs up, kr0000002 for the second user that signs up and so on. could you please let me know this.
Thanks,
Harish.February 4, 2019 at 4:09 am #28398harishParticipantHI I see that there is an entry number for each form submitted. Is there a way to generate a member ID out of it? and save it to the database or supply it to buddypress extra fields?
Please help.
Thanks,
Harish.February 5, 2019 at 4:39 pm #28404harishParticipantHi
My client is so peculiar about “member ID”. We have implemented your guide (http://support.themecatcher.net/quform-wordpress-v2/guides/integration/creating-a-user) to setup wordpress user when the submit the form.
Thanks for the link to buddypress registration form as well.
Is there any way we can convert the Form “entry ID” into a member ID with a prefix to it? Right now I see that you have “entry ID” for each form that is being submitted.
We want to add a prefix to this entry ID and make it a member ID. and use the member ID as the default username with which the User can login. (instead of a username that the user provides, we want to have the user use the member ID that is being generated automatically).
This is the only requirement we are struggling to come up with using your plugin.
Please help us out.
Thanks,
Harish.February 6, 2019 at 9:41 am #28413AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
February 10, 2019 at 3:39 am #28485harishParticipantHi Thank you for the example,
We did try implement it. But the Field IDs are editable by the user and we can’t use field ids to login instead of username.
So, instead of user input for username, we want the username itself to be the member ID that automatically increments. So, no one can change the member ID and the user can login using the member ID (as username).
add_action('quform_post_process_1', function (array $result, Quform_Form $form) { if (function_exists('bp_core_signup_user')) { $username = $form->getValueText('quform_1_45'); $email = $form->getValueText('quform_1_6'); $password = $form->getValueText('quform_1_44'); // Profile fields $usermeta = array( 'field_1' => $form->getValueText('quform_1_4'), 'field_2' => 'kr' . $form->getEntryId(), ); $usermeta['profile_field_ids'] = '1,2'; $usermeta['password'] = wp_hash_password($password);
we would like to assign ‘kr’ . $form->getEntryId() to the $username
add_action('quform_post_process_1', function (array $result, Quform_Form $form) { if (function_exists('bp_core_signup_user')) { $username = 'kr' . $form->getEntryId(); $email = $form->getValueText('quform_1_6'); $password = $form->getValueText('quform_1_44'); // Profile fields $usermeta = array( 'field_1' => $form->getValueText('quform_1_4'), ); $usermeta['profile_field_ids'] = '1'; $usermeta['password'] = wp_hash_password($password);
But when we try to use the modified code, it won’t work.
All we need now is to assign the $username to ‘kr’ . $form->getEntryId()
So, users can use the kr{entry_id} as username.Is there anyway you can help us pleaseeee?? if this is solved, we can close this ticket.
February 10, 2019 at 3:41 am #28486harishParticipantI attached the code that worked and the code that didn’t work for your reference. Thanks a bunch.
Attachments:
You must be logged in to view attached files.February 10, 2019 at 12:42 pm #28507AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
February 10, 2019 at 6:32 pm #28526harishParticipantI edited the config file and submitted the form. I didn’t see anything strange in Debug.log file.
After submitting the form, I don’t see the user listed in BuddyPress users (neither in ‘all’ nor in ‘pending’ users list). So, The username is not going through when I tried to assign ‘kr’ . $form->getEntryId() to the $username but it works perfectly
add_action('quform_post_process_1', function (array $result, Quform_Form $form) { if (function_exists('bp_core_signup_user')) { $username = 'kr' . $form->getEntryId(); $email = $form->getValueText('quform_1_6'); $password = $form->getValueText('quform_1_44');
Is there something else I could try?? Not sure what else I can do but I’m missing something within the code.
February 10, 2019 at 6:33 pm #28527February 11, 2019 at 7:18 pm #28532harishParticipantHi Any chance you can help us on this?
$username = 'kr' . $form->getEntryId();
If we can assign entry ID to $username or have an unique number automatically be assigned to $username we could get this problem resolved and get going.
Please let us know if you can help.
Thanks,
Harish.February 14, 2019 at 5:59 am #28550harishParticipantHI Ally,
Still looking forward to a reply. Is there any way we can autogenerate MemberID for all who submit the form and use those memberIDs as username for the users to login?
Please kindly give one last solution. If I can’t get it to work, I will have to go through an entirely different approach and different plugin and start from scratch.
February 15, 2019 at 4:32 pm #28567AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 9, 2019 at 11:52 pm #28729harishParticipantHi Ally,
Thank you for all your support. I got it to work with your guidance. This case is now resolved.
We really appreciate your support.
Thanks,
Harish. - AuthorPosts
- You must be logged in to reply to this topic.