Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Pop up shows for all drop down lists

Rlowen
Contributor II

Ive read through the other posts as best as I can but I am too new at js to know what I am omitting....

I have a popup configured when a value is selected from one drop down.  problem is the pop up shows id any other drop down on the page is changed.  Can I fix this?

<script>
Sys.Application.add_load(function() {

$('div[id*="f'+ 17305 +'c"]').change(function() {

if($CM.getFieldValue(17305) == '93262:0' || $CM.getFieldValue(17305) == '0:0'){


window.open("https://archer.company.com/RSAarcher/company_files/50000/popup2.html", "_blank", "width=637, height=833");
}
});
});
</script>

1 REPLY 1

DavidPetty
Archer Employee
Archer Employee

@Rlowen see how this works.

<script>
     MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

     var trackChange = function(element) {
          var observer = new MutationObserver(function(mutations, observer) {
               if(mutations[0].attributeName == "value") {
                    $(element).trigger("change");
               }
          });
          observer.observe(element, {
               attributes: true
          });
     }

     // Just pass an element to the function to start tracking
     trackChange( $('input[id$=f23329c_shf]')[0] );

     Sys.Application.add_load(function() {
          $('input[id$=f23329c_shf]').change(function() {
               if(this.value == '93262:0' || this.value == '0:0'){
                    window.open("https://archer.company.com/RSAarcher/company_files/50000/popup2.html", "_blank", "width=637, height=833");
               }
          });
     })
</script>

 Advisory Consultant