I have two fields
1. request status (Radio Button)
2. Payment (Select)
I would like to display the payment only if the request status = 1,
What I did is
<div class="form-group" hidden>
[cred_field field="request-status" force_type="field" class="form-control" output="bootstrap"]
[cred_field field="payment" force_type="field" class="form-control" output="bootstrap"]
</div>
[cred_show_group if="( $(request-status) eq '1' )" mode="none"]
[types usermeta='payment' user_is_author='true'][/types]
[/cred_show_group]
but the payment value is not showing in the form. What is wrong??
I would like to display the payment only if the request status = 1...but the payment value is not showing in the form. What is wrong??
Hi, do you see the correct value appear in the Form if you paste the Types usermeta shortcode outside the cred_show_group conditional shortcode? Like this test, which should show the existing payment field value regardless of the form field selections:
Test value: [types usermeta='payment' user_is_author='true'][/types]<br />
[cred_show_group if="( $(request-status) eq '1' )" mode="none"]
[types usermeta='payment' user_is_author='true'][/types]
[/cred_show_group]
If the results aren't what you expect, please provide a bit more detail about what you want to accomplish. The "user_is_author" attribute may be a bit ambiguous here, depending on what kind of Form you have created, and where the Form is placed on the site.
do you see the correct value appear in the Form if you paste the Types usermeta shortcode outside the cred_show_group conditional shortcode?
I have tried, it is not appearing. so the issue is the value is not retrieved from the database.
The idea is that we have a user form that the user has to apply and pay after the registration. And the payment status value should be unpaid by default until he paid. I would like to show the payment status in the user profile. but it is not appearing.
I have tried, it is not appearing. so the issue is the value is not retrieved from the database.
Yes that could be part of the issue. It could also be the case that the value is not set by default properly. First, if you want to display information about the current, logged-in User, you should probably use the Types field shortcode format with user_current instead of user_is_author:
Test value: [types usermeta='payment' user_current='true'][/types]<br />
That should display information from the 'payment' field for the current, logged-in User. If this still does not display the expected value, the field is not being set properly by default. You should consider how the custom field is being set by default in the registration Form. Is the field present in the registration form? If not, you may need to set the value programmatically using custom code with our Forms APIs like cred_save_data.
I can offer more guidance if you care to explain how the payment field is set by default, and how it is changed upon payment. I'll need more technical details about your purchase process.
Many Thanks. it displayed now after i added user_current='true'.