Problem when there are two registration forms on the same page

This topic contains 11 reply and 5 voices, and was last updated by Abdul Aziz 8 years, 8 months ago
Viewing 11 Posts - 1 through 11 (of 11 total)
Author Posts
March 25, 2013 at 11:39 am 1493
Abdul Aziz 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?  
March 25, 2013 at 12:39 pm 1497
Tareq Hasan Tareq Hasan

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.

March 25, 2013 at 6:48 pm 1503
cmorillas cmorillas

Thank you.

March 25, 2013 at 7:29 pm 1505
cmorillas cmorillas

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

March 25, 2013 at 8:10 pm 1506
cmorillas cmorillas

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.

March 26, 2013 at 2:51 am 1512
Tareq Hasan Tareq Hasan

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?

March 26, 2013 at 3:20 pm 1537
cmorillas cmorillas

Yes.iThat s the problem. Any solution?Y

March 26, 2013 at 3:29 pm 1538
Tareq Hasan Tareq Hasan

Look at the frontend-form-profile.php line: 309, it looks like this:
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’] : ”,

Now replace that code with this:

$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’];

March 27, 2013 at 11:12 am 1552
cmorillas cmorillas

It works !!!

Thank you.

April 5, 2013 at 8:20 am 1819
ivaxtobac ivaxtobac

It works fine. Thanks!!!

May 22, 2014 at 11:13 am 20826
Alex Alex

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?


January 13, 2015 at 7:04 am 34003
Abdul Aziz Abdul Aziz

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 11 Posts - 1 through 11 (of 11 total)