EDIT: I idiotically misread your question - but the logic in this answer may still work, or at least get you on the right path.
Yeah, definitely possible!
First, update your embed code slightly like so:
You’ll need to add a field to the collection you’re referencing called ID (or something along those lines) and create a unique value for each free course. Make sure there is no overlap in IDs and that they are truly unique. IDs are unique to the page, so if you have two radio buttons with the same IDs, you’ll run into issues.
Anyway - once you have unique IDs for your free courses, replace my string (between the quotes) with the +Add Field
button and reference the newly created ID field.
You’ll need some custom code in the Page Footer (before Body), so here’s an example to get started:
Let’s say you added a field in your CMS for the ID already. In regards to the ID, you set an ID for the Benefits of Prevail course to prevailBenefits
. Let’s also say you have another course - which we’ll call Course 2.
Course 2 is accessible at https://www.ormsonlawtraining.com/courses/course-2. You’ve assigned an ID of coursetwo
for the radio button embed element.
In Javascript, you would do as follows:
<script>
var Webflow = Webflow || [];
Webflow.push(function () {
// DOMready has fired
// May now use jQuery and Webflow API
var selection = window.location.pathname.split("/").pop();
if (selection = 'benefis-of-prevail') {
// heads up on the typo in your URL! Benefits vs benefis
document.getElementById("prevailBenefits").checked = true;
} else if (selection = 'course-2') {
document.getElementById("coursetwo").checked = true;
}
});
</script>
You repeat those else if
statements for each use case you have. There is likely a more efficient way to do this via JS, but considering you probably have 3 free courses (just guessing from what I see, correct me if I’m wrong), it would like be easier to just write out each else if. (In this case, you’d only have to add one more else if statement just like you see above and you’re done!)
Let me know if this helps!