web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Entity form - Liquid a...
Power Pages
Unanswered

Entity form - Liquid and JavaScript - issue with JS disabled on browser

(0) ShareShare
ReportReport
Posted on by 20

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>

 

Categories:
  • Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    With javascript use jQuery to append the span and then to show/hide it inside your on change function

     

    $( "#fieldschemaname" ).parent().append( "<span>Test</span>" );
    
    $("#yourspanid").hide();
    
    $("#yourspanid").show();

     

     

    Without JavaScript, you pretty much are limited e.g. you cannot pick up an onchange event.  And the Liquid doesn't have a redirect available from the template.  I can't think of a viable way to do what you want other than putting "You need to have JavaScript enabled to use this site" if it is not enabled.

     

    Only way I could think of was if you had a standard submit button wrapped in html Form tag and in its 'action=' point to another page - but what you have is sitting on a standard Entity Form then this button would need to sit above or below the form details (as you don't have direct access inside the Entity form area without JavaScript - and the field is already inside a form submit).

     

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 47

#2
M Bilal Khan Profile Picture

M Bilal Khan 44

#3
sannavajjala87 Profile Picture

sannavajjala87 30 Super User 2026 Season 2

Last 30 days Overall leaderboard