Hi, i've this form:
[credform]
[cred_field field="form_messages" class="alert alert-warning"]
<div class="form-group" id="select-number-field">
<label>Adult </label>
[cred_field field='adult-number' value='' urlparam='' select_text='Quanti adulti?' class='form-control' output='bootstrap']
</div>
<div class="form-group" id="select-number-field">
<label>Child</label>
[cred_field field='children-number' value='' urlparam='' select_text='Quanti bambini?' class='form-control' output='bootstrap']
</div>
[cred_show_group if="($(price-calculation) eq '1' ) OR ($(price-calculation) eq '2' )" mode='fade-slide']
<div class="form-group" id="select-number-field">
<label>Room</label>
[cred_field field='room-number' value='' urlparam='' select_text='Quante camere?' class='form-control' output='bootstrap']
</div>
[/cred_show_group]
<div class="form-group" id="select-number-field">
[cred_field field="form_submit" output="bootstrap" value="Prenota" class="request-button btn btn-primary btn-lg"]
</div>
[/credform]
As you can see I've use a condition to display the field room.
But doen't works. the filter is "price-calculation" which is a custom field og a different group then the fields of the form (adult, child and room)
How can I do this condition?
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Domenico,
Thank you for contacting our support forum.
You are saying that the field in the conditional is from another post itself?
Also where is the form, is it on the parent post ? Was it navigated to from the Parent post?
Please let me know as your current setup will not work since the field is not on the actual post itself.
Thanks,
Shane
Hi Shane,
The form is "Booking form" and it creates new custom post typ "my-orders"
In this form there is a field "room-number" which is part of a custom field group associated to custom post typ "my-orders"
I've also a field "Type-of-price" whcih is aprt of a custom field group associated to "woocommerce product"
I need to use this last (type-of-price) as condition to display "room-number"
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Domenico,
You mean that you need to get the price of the last person who booked and use that to generate a new price to add to the conditional ?
Please let me know.
Thanks,
Shane
Hi Shane,
No, what I mean is easyer (I think).
[cred_show_group if="($(price-calculation) eq '1' ) OR ($(price-calculation) eq '2' )" mode='fade-slide']
<div class="form-group" id="select-number-field">
<label>Room</label>
[cred_field field='room-number' value='' urlparam='' select_text='Quante camere?' class='form-control' output='bootstrap']
</div>
[/cred_show_group]
price-calculation should be my "filter" In base of its value the field. "price-calculation " is in a group custom field associated to woocommerce product.
The form and all the fields are associating to custom post type "my-orders"
"product" and "my-orders" are not related
Shane
Supporter
Idiomas:
Inglés (English )
Zona horaria:
America/Jamaica (GMT-05:00)
Hi Domenico,
I don't think i'm seeing the bigger picture.
For the cred_show_group conditional code to work, the value you are checking must be on the form itself.
Is this field entered on the form ? Or is the value of this field being retrieved from somewhere else ? This is the part i'm not sure about.
Thanks,
Shane