Hi,
in the Backend I there are several Custom Fields in a CPT. I created a Custom Field called "Einzelzimmer-Zuschlag Preis" (see picture "Einzelzimmer_Zuschlag_1.jpg"). When I create a "Veranstaltung" and use this field in the Backend (see "Einzelzimmer_Zuschlag_2.jpg") and than want to display this field in my Toolset Form (Cred), the Label with the Types Field "Einzelzimmer-Zuschlag Preis" doesn't appear (see "Einzelzimmer_Zuschlag_3.jpg").
Here is the code:
[code]
[wpv-conditional if="($(wpcf-einzelzimmer-zuschlag) eq '1' )"]
<div class="form-group">
<label>Einzelzimmer-Zuschlag Euro pro Nacht ([types field='einzelzimmer-zuschlag-preis' output='raw'][/types] Euro pro Nacht)</label>
[cred_field field='einzelzimmer-zuschlag-formular' force_type='field' class='form-control' output='bootstrap']
</div>
[/wpv-conditional]
[/code]
If I delete the part:
[code]
[types field='einzelzimmer-zuschlag-preis' output='raw'][/types]
[/code]
the Label shows (see "Einzelzimmer_Zuschlag_4.jpg").
Why does it not work, when I use the Types Field? Strange thing is, that I use another Types Field in the (Cred) Toolset Form on another Place, which works well.
Thanks
Thorsten
Are you saying if you use the types shortcode within the label tag it doesn't work? However if you use a different custom field displayed with the types shortcode it works ? Is the shortcode also inside a label tag?
Please let me know so that I can attempt to replicate the issue.
Hi Shane,
yes, the Lable doesn't display. However, it doesn't matter, if I use thhis code inside or outside the label. In both cases, the label isn't visible. I also tried to set it in a p-Tag, but this doesn't work either. However for the other code, it work's (which is in a P-Tag). This is the code, that works:
<p>Buchungs-Nr.: [types field='veranstaltungsnummer_neu' output='raw'][/types]</p>
and that is the code, which doesn't work:
[wpv-conditional if="($(wpcf-einzelzimmer-zuschlag) eq '1' )"]
<div class="form-group">
<label>Einzelzimmer-Zuschlag Euro pro Nacht ([types field='einzelzimmer-zuschlag-preis' output='raw'][/types] Euro pro Nacht)</label>
[cred_field field='einzelzimmer-zuschlag-formular' force_type='field' class='form-control' output='bootstrap']
</div>
So my questions are:
- Why is the second code not working?
- How can I display a Custom Field within a cred form?
PS: If you need access to the Website, I can give you access.
Thanks
Thorsten
Hi SHane,
thanks for this sollution, but the problem is, that the client doesn't want to display the field at this place. Indeed, this is a very strange behaviour. Is there a way to display it with PHP code like in this example? https://toolset.com/forums/topic/displaying-custom-fields-on-the-sites-front-end-woocommerce-product-page/
I tried it with <?php echo 'This is a Test' ?> to test it in general, but it doesn't work.
Thanks
Thorsten
This seems to be an issue with the form itself and unfortunately no the field will need to be displayed in the code of the form to work correctly.
I believe the issue might be with the form itself and I would recommend remaking it.
Currently I see where it works if you have a copy of the field on the page itself so this is a temporary workaround to the issue. I would recommend remaking the form as a test to see if the issue is present in the new form as well.
Hi Shane,
I created a new form. Unfortunaltely, it's the same issue. I attached two screenshots. In the first screenshot you will see, that if you insert hte types field for "Einzelzimmer Zuschlag", many fields disappear. If you delete the Types field, everything works as expected. I even deleted the old custom fields and created new ones, but the same issue. I guess, it has to be a Bug with Toolset itself. I now entered the number manually (static). Than, of course, it works, but this is only a workaround and not the solution for the bug. Is there a way to solve this issue?
Also you can see on the screenshot (sorry, it's very smal), that there is a little star (*) at the end of the senetence "Datenschutz und Stornogebühren gelesen und akzeptiert*". Where does this star come from?
Hi Shane,
that's fine for me. You can create a Copy from the Site to test the issue on your side.
Ok, but as far as aI and my client know, the asterisk was not there befor the Toolset Update. The other fields are also required, but they don't show the asterisk, so that's a bit strange for us.
Thanks
Thorsten