Home Forums Plugin Support WP User Frontend Pro Problem when there are two registration forms on the same page

This topic is: resolved

This topic contains 11 replies, has 5 voices, and was last updated by  Abdul Aziz 4 years, 4 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1493

    cmorillas
    Participant
    Post count: 29

    Hi guys,

    I have two registration forms, and I use them only for profile updater. (type=”profile”).

    One of these forms is used to allow user update some fields, and the other has another different fields to be updated.

    I have a page called profile updater which has several tabs. I place one form in one tab and the other form in the other tab.

    The problem is that only the first one is working, the second form doesn't update anything.

    Any suggestion?

     

    #1497

    Tareq Hasan
    Keymaster
    Post count: 2831

    I guess the problem is happening because the form ID. As only one ID is supposed to be in a page, now as you've multiple forms, this isn't working.

    The quick solution would be changing the form ID to class. So currently there is [php]<form id="wpuf-form-add" action="" method="post">[/php]. You need to change this to: [php]<form class="wpuf-form-add" action="" method="post">[/php]. You need to change both post and profile form ID's this way. Look into /class/frontend-form-profile.php line:66 and /class/render-form.php line:267.

    Now you need to change the JavaScript in /js/frontend-form.js line 9, change [code lang="js"]$('#wpuf-form-add').on('submit', this.formSubmit);[/code] to [code lang="js"]$('.wpuf-form-add').on('submit', this.formSubmit);[/code]. That should work. I'll also update the code as others might run into the same problem.

    #1503

    cmorillas
    Participant
    Post count: 29

    Thank you.

    #1505

    cmorillas
    Participant
    Post count: 29

    I have do all the things, but when I update in the second form, the first registration form doesn't display the email field.

    #1506

    cmorillas
    Participant
    Post count: 29

    Not only the email. All the data of the profile fields has been removed when pushing the button in the second form.
    If I update from the first form (the one which has the profile fields) it updates fine.

    #1512

    Tareq Hasan
    Keymaster
    Post count: 2831

    Right, just tested it. So with multiple forms this bug appears for First name, Last name, Nick name, User URL and description. Isn't that right?

    #1537

    cmorillas
    Participant
    Post count: 29

    Yes.iThat s the problem. Any solution?Y

    #1538

    Tareq Hasan
    Keymaster
    Post count: 2831

    Look at the frontend-form-profile.php line: 309, it looks like this:
    [php]
    userdata = array(
    ‘ID' => $user_id,
    ‘first_name' => $this->search( $user_vars, ‘name', ‘first_name' ) ? $_POST[‘first_name'] : ”,
    ‘last_name' => $this->search( $user_vars, ‘name', ‘last_name' ) ? $_POST[‘last_name'] : ”,
    ‘nickname' => $this->search( $user_vars, ‘name', ‘nickname' ) ? $_POST[‘nickname'] : ”,
    ‘user_url' => $this->search( $user_vars, ‘name', ‘user_url' ) ? $_POST[‘user_url'] : ”,
    ‘user_email' => $this->search( $user_vars, ‘name', ‘user_email' ) ? $_POST[‘user_email'] : ”,
    ‘description' => $this->search( $user_vars, ‘name', ‘description' ) ? $_POST[‘description'] : ”,
    );
    [/php]

    Now replace that code with this:

    [php]
    $userdata = array(‘ID' => $user_id);

    if ( $this->search( $user_vars, ‘name', ‘first_name' ) ) {
    $userdata[‘first_name'] = $_POST[‘first_name'];
    }

    if ( $this->search( $user_vars, ‘name', ‘last_name' ) ) {
    $userdata[‘last_name'] = $_POST[‘last_name'];
    }

    if ( $this->search( $user_vars, ‘name', ‘nickname' ) ) {
    $userdata[‘nickname'] = $_POST[‘nickname'];
    }

    if ( $this->search( $user_vars, ‘name', ‘user_url' ) ) {
    $userdata[‘user_url'] = $_POST[‘user_url'];
    }

    if ( $this->search( $user_vars, ‘name', ‘user_email' ) ) {
    $userdata[‘user_email'] = $_POST[‘user_email'];
    }

    if ( $this->search( $user_vars, ‘name', ‘description' ) ) {
    $userdata[‘description'] = $_POST[‘description'];
    }
    [/php]

    #1552

    cmorillas
    Participant
    Post count: 29

    It works !!!

    Thank you.

    #1819

    ivaxtobac
    Participant
    Post count: 35

    It works fine. Thanks!!!

    #20826

    Alex
    Participant
    Post count: 27

    Hi @tareq,

    Just about to add two wpuf forms to a single page, as mentioned in this topic. Is the solution outlined in this topic still necessary given most recent version of WPUF Pro?

    Thanks,
    lex

    #34003

    Abdul Aziz
    Member
    Post count: 2

    morning All,
    as we know there is a little profil field @ wp user – pro, like username, first name – avatar,
    no filed for adress, city, zipcode, etc.

    how can i make it ? anybody help ?
    custom field for ; adress, phone, city, state, zipcode ?

    i did it with text (custom field @ wp user), but there is no meta key for that ???

    thanks a lot for attention..

Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Problem when there are two registration forms on the same page’ is closed to new replies.