I am in need of some help........tried several different ways to hide/show a section on an entity form that is displayed in our D365 portal.
Here is the code:
I am in need of some help........tried several different ways to hide/show a section on an entity form that is displayed in our D365 portal.
Here is the code:
Maulik,
Thanks for the info however this does not resolve the issue I am having. I have tried multiple ways but my code is not working, It will hide the section but when I change the value of the drop down or radio button it does not show.
$(function() {
$("new_incidentreport").change(onDisplaySectionChange);
onDisplaySectionChange();
});
function onDisplaySectionChange() {
var selectedValue = $('#new_incidentreport').find("option:selected").text();
if (selectedValue === "No")
{
$(".section[data-name='incident_info']").closest("fieldset").hide();
}
else if (selectedValue === "Yes") {
$(".section[data-name='incident_info']").closest("fieldset").show();
}
}
Hello marisolcastro,
Pls refer this thread to hide/show a section on an entity form that is displayed in our D365 portal
I hope it helps,
Thanks.
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Portal.
Hi Steve!
So I went ahead and changed it from a checkbox to the radio button under the formatting option of the form. The source code now shows the field with [tag:new]_incidentreport_0 and [tag:new]_incidentreport_1 as you showed above. I tried so many different scenarios to get my section (incident_info) to show if I selected Yes but nothing works. I feel like the 'else' statement is not working properly and I am not sure what else to try. Any ideas would be greatly appreciated.
here is the new code:
$(document).ready(function () {
$("[tag:new]_incidentreport_0").change(onDisplaySectionChange);
onDisplaySectionChange();
});
function onDisplaySectionChange() {
var optionOne = $("[tag:new]_incidentreport_0").val();
var optionTwo = $("[tag:new]_incidentreport_1").val();
if (optionOne == 0) {
$(".section[data-name='incident_info']").closest("fieldset").hide();
}
else if (optionTwo == 1) {
$(".section[data-name='incident_info']").closest("fieldset").show();
}
}
Hi marisolcastro,
It seems that "new_request" is the logical name of your checkbox field. I have added a checkbox to the basic form and check this element's id.
The "new_request" is the span tag id, the checkbox id is "new_request_0" and "new_request_1". So you need to monitor these two inputs' change event rather than "new_request".
Screenshot:
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156