Skip Navigation

[Resolved] keep showing messge after submiting the form

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by salimA 3 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#1965079
1.JPG
2.JPG
3.JPG

Hi

I have a user form. when a new user registers, the user status default value is pending.

And there is a page for admins with a view to display all users. the admin should be able to update the user status from pending to approve or reject. as on the attached image 3 (which is working fine).

After submitting the form ;
Currently: it displays rejected or approved like on the attached image 2 (which is fine). But, after I refresh the page, the form shows again like on image 1.
I want: to keep displaying the message all the time even if I refresh the page.

I used the below code to display the message based on the status.

[wpv-conditional if = "( '[types usermeta='request-status' output='raw' current_user='true'][/types]' eq '1' )" ]
Approved
[/wpv-conditional]
[wpv-conditional if = "( '[types usermeta='request-status' output='raw' current_user='true'][/types]' eq '2' )" ]
Rejected
[/wpv-conditional]

How can we do it ??

#1965969

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Salim,

Thank you for getting in touch.

This seems to be a case where you need to use some conditionals on this listing page for the user. I'm assuming that under specific conditions such as "pending"you want the form to display for the admins so they can change it to Rejected or Approve.

In this case you will need to write a 3rd conditional for "pending" so the admin can only see the form for the pending users. So it would look like this below.

[wpv-conditional if = "( '[types usermeta='request-status' output='raw'][/types]' eq '1' )" ]
Approved
[/wpv-conditional]
[wpv-conditional if = "( '[types usermeta='request-status' output='raw'][/types]' eq '2' )" ]
Rejected
[/wpv-conditional]
[wpv-conditional if = "( '[types usermeta='request-status' output='raw'][/types]' eq '3' )" ]
Form shortcode goes here

[/wpv-conditional]

Essentially the form will only load when the status is set as Pending. Please let me know if this is exactly what you are referring to. If not then further clarity will be needed on this.

Thanks,
Shane

#1966321
toolset.JPG

Hi Shane,

thank you for your reply.

I have tried to add this code in the form settings as on the attached image, but still, when I refresh the page the form displayed again. I have tried to add it also on the view but still the same.

#1966895

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Salim,

Would you mind allowing me to have admin access to the site so that I can have a first hand look at the issue ?

I've enabled the private fields for your next response. Also please send a link to the page where I can see the issue.

Thanks,
Shane

#1971109

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Salim,

Thank you for the credentials,

I took a look at the site further and the problem was that you were using the current_user ='true' attribute for the meta fields.

What this actually does is get the custom field information of the currently logged in user and not the user that is being displayed by the view loop.

To resolve this all I did was to remove the current_user=true from the shortcode and it started showing the form only for users who have a pending status.

Thanks,
Shane

#1971617

Many thanks for your support Shane. My issue is resolved now.