Hello,
I have implemented a web page with Entity form and it has a radio button field.
When user clicks on 'Yes', I want to display a message in <span> tag just below the field.
I don't want to keep everything in Javascript, because if JS is disabled on user browser, then below logic is not going to work.
I want to use liquid AND javascript for that reason. Below is my javascript function and I'm not sure how I can use Liquid here to set span tag.
<script>
$(document).ready(function () {
$("#cr157_language").val("{{ portallanguage }}");
$("#cr157_allergy input[type=radio]").change(radiobuttonChange3a);
});
function radiobuttonChange3a()
{
var language = window.location.href;
if (document.getElementById("cr157_allergy_0").checked)
{
if(language.includes("en-US"))
{
alert("English message"); // SET SPAN tag using liquid
}
else
{
alert("Other message"); // SET SPAN tag using liquid
}
}
}
</script>