Member Registration Form – Dynamic Member ID and Validating email

Home Forums Quform WordPress Member Registration Form – Dynamic Member ID and Validating email

This topic is: resolved

This topic contains 15 replies, has 2 voices, and was last updated by  Ally 4 months, 1 week ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #28364

    harish
    Participant

    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 regard

    Please help us out.
    Thanks,

    #28385

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28391

    harish
    Participant

    Thank 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.

    #28398

    harish
    Participant

    HI 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.

    #28404

    harish
    Participant

    Hi

    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.

    #28413

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28485

    harish
    Participant

    Hi 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.

    #28486

    harish
    Participant

    I 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.
    #28507

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28526

    harish
    Participant

    I 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.

    #28527

    harish
    Participant

    debug file attached.

    Attachments:
    You must be logged in to view attached files.
    #28532

    harish
    Participant

    Hi 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.

    #28550

    harish
    Participant

    HI 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.

    #28567

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28729

    harish
    Participant

    Hi 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.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.

Be inspired. © 2019 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy