cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Re: Show/Hide Section based on Yes/No toggle - JavaScript

Ahh ok cool i did think if i was using the wrong type on control 🙂

 

sorry still a bit confused where would i put the new bit of code? do i need to replace something?

 

var selectedValue = GetRadioSelectedValue($('#callingonbehalfof'))

  i really very new to Javascript :) like days new lol 

 

Many Thanks

Highlighted
Super User II
Super User II

Re: Show/Hide Section based on Yes/No toggle - JavaScript

Hi

try the following:

$(document).ready(function () {
    debugger;
    onDisplaySectionChange();
    showHideFieldsandTab();

});

function showHideFieldsandTab() {
    $("#iii_callingonbehalfof").change(onDisplaySectionChange);
}

function onDisplaySectionChange() {
    var selectedValue = GetRadioSelectedValue($('#iii_callingonbehalfof'));
    if (selectedValue != "1") {
        $("table[data-name='Your_Information']").parent().show(); /// and .hide();
    }
    else {
        $("table[data-name='Your_Information']").parent().hide(); /// and .hide();;
    }
}

GetRadioSelectedValue = function(input) {

    if (!!$(input).find("input[type=radio]")) {
        var controlName = $(input).find("input[type=radio]").first().attr("name");
        if (!!controlName) {
            return $("input[name='" + controlName + "']:checked").val();
        }
    }
    return "";
};

View solution in original post

Highlighted
Helper I
Helper I

Re: Show/Hide Section based on Yes/No toggle - JavaScript

@OliverRodrigues  - Mate your legend!! 

 

its now working 🙂 

 

i did also change the radio box to a dropdown and that also worked 🙂 

 

thank you so much for you help 🙂 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (4,925)