Hi Beda
Thanks for your answer.
I googled some more and found the following topic:
https://toolset.com/forums/topic/labels-for-cred_field-with-for-and-id-elements/#post-359302
With the information in the above post, I achieved to assign the input-element-attribute "id" of "post_title" to its respective label-element (#choose-me) by using the following code:
jQuery( document ).ready(function() {
id_of_post_title = jQuery('input[name="post_title"]').attr('id');
console.log(id_of_post_title, "Hello, world");
jQuery('#choose-me').attr('for', id_of_post_title);
});
Now when the page gets rendered, the label-element gets assigned the correct "id" - thats great! However: the needed css-animation doesn't work.
I played around within the inspector and found out, that, when putting the "<label ...> ... </label>"-lines inside the auto-generated "<div ...> ... </div>" above, the animation starts working.
Thats how the code should be rendered ...
[credform class='cred-form cred-keep-original']
[cred_field field='post_title' post='arbeitgebende-r' value='' urlparam='' class='input__field input__field--haruki']
<label class="input__label input__label--haruki" id="choose-me" for="">
<span class="input__label-content input__label-content--haruki">Titel</span>
</label>
[/credform]
Thats how it gets rendered ...
<form id="cred_form_29_1" class="cred-form cred-keep-original" action="/administration/arbeitgebende-r-hinzufuegen/?_tt=1511034463" method="post">
<div class="js-wpt-field-items js-wpt-repetitive wpt-repetitive" data-initial-conditional="" data-item_name="textfield-post_title">
<input type="text" id="cred_form_29_1-textfield-1-1511034463" name="post_title" value="" class="input__field input__field--haruki wpt-form-textfield form-textfield textfield textfield" output="" preset_value="" urlparam="" value_escape="" make_readonly="" placeholder="" select_text="" data-wpt-validate="{"required":{"args":{"1":true},"message":"This field is required"}}" data-wpt-field-title="Arbeitgebende/r-Name" data-wpt-type="textfield" data-wpt-id="cred_form_29_1_cred_form_29_1-textfield-1-1511034463" data-wpt-name="post_title" />
</div>
<label class="input__label input__label--haruki" id="hierbinich" for="">
<span class="input__label-content input__label-content--haruki">Titel</span>
</label>
NOTE: the last 3 lines should be rendered inside their above div-element to get things working.
My question: how can I insert code inside the code that gets generated by the shortcode? Or is there a possibility of doing some jQuery for this and change the order after rendering? I already tried appending those 3 lines via jQuery but as I am not a programmer, it's really hard for me finding out the proper code ...
Thanks for your help!
Regards
Philip