I am created a dropdown in a form, populated by a cpt.
Have created a view of a cpt and output as json.
If I add the view, in options of a generic select, nothing is output
[cred_generic_field field="student-id" type="select" class="" urlparam=""]
{
"required":1,
"validate_format":0,
"persist":1,
"default":"",
"options":[[wpv-view name="student-list-dropdown"]]
}
[/cred_generic_field]
If I copy and paste the output into options (so options are hardcoded), then it outputs fine?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Terry,
Thank you for getting in touch.
I suspect that this is because you dont have the option "Disable the wrapping DIV around the View" checked on your view.
Go back to your view and ensure that this is checked. This will remove the wrapping outer divs in your view to ensure that only the JSON output is being produced.
Thanks,
Shane
Thanks for this 🙂
I have ticked the box on the views, but the dropdowns are still blank 🙁
Is there anything else worth trying?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Terry,
I will perhaps need to look at the site itself.
Would you mind allowing me to have admin access to the site ? I will need a link to the front end for the form as well as the link for the view on the backend.
I've enabled the private fields for your next response.
Thanks,
Shane
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Terry,
Thank you for the continued Patience. This should now be working.
Thanks,
Shane
Thanks for that Shane. What was the issue?
Cheers,
Terry.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Terry,
I cant be sure exactly however what resolved the issue is where I placed the closed bracket in a separate line like below.
[cred_generic_field field="student-id" type="select" class="" urlparam=""]
{
"required":1,
"validate_format":0,
"persist":1,
"default":"",
"options":[[wpv-view name="student-list-dropdown"]
]
}
[/cred_generic_field]
Thanks,
Shane