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

Notifications

Announcements

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:
I have the same question (0)
  • Fubar Profile Picture
    8,361 Super User 2025 Season 2 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,368 Most Valuable Professional on at

    Hi @MittalPatel I am not sure what's the difference between this post and this?: https://powerusers.microsoft.com/t5/Power-Apps-Portals/Entity-Form-Advanced-Settings-Custom-javascript-gt-Not-working/m-p/860839

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard