Tell us what you are trying to do?
I have a site with domains for sale. Each domain gets its own page. I have a cred form on each of the domain pages to allow a user to inquire about that domain. I have a field for the domain and I want that to be filled in automatically based on the current post. The current post is a custom post type called "Domains" created with toolset types. The title of that post is the domain name. Alternatively, we can get it from the URL since the URL contains the domain name.
What is the link to your site? hidden link hidden link
The data I want auto-populated in the Domain field is the "女.com" or "男.com" part.
I saw we can do it with URL parameters but my pages have the domain in the URL path itself, not as a parameter.
If you are displaying a CRED form on a page where you want to use the title of that page within the form (to set a value attribute) you can simply use the [wpv-post-title] shortcode.
The context for that shortcode is the page itself where the form is diplayed.
Thanks for the reply. Yeah, I tried that after seeing it in some other support requests... but it doesn't work for me. I changed the value='' part that was created by default to value='[wpv-post-title]':
I think I saw something similar a few days ago with a colleague, where the advice was to not use do_shortcode to render CRED forms in PHP templates and to insert the form directly using the cred_form function.
It takes one attribute, form, with the slug of the form in question, e.g.
<?php cred_form( form="form-slug" ); ?>
Can you try inserting your form like that and see if the title shortcode then works?
I set up a site locally to test this where I directly render a form in a PHP template using cred_form( 'page-slug' ) and where I use [wpv-post-title] for the value attribute of one of the form fields and it worked as expected.
What kind of field is the form field in question? I was just populating a text field in my test.