Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: cfselect onClick

$
0
0

I didn't run your code as I can't copy & paste from the code block in your example and I was too lazy to brute force the issue (silly forum software). Your issue may simply be the "javascript:" in the onClick parameter -- it's not needed.

 

I use jQuery everywhere. Here is the code I wrote that I think does what you are asking:

 

  <script type="text/javascript">

   function resetBusiness(_this) {

    var isValid = false;

    $("#sDiv :selected").each(function(i, selected){

     isValid = isValid || $(selected).val().length;

    });

    if(isValid) {

     $("#sBus :selected").each(function(i, selected){

      $(selected).removeAttr("selected");

     });

    }

   }

  

   function resetDivision(_this) {

    var isValid = false;

    $("#sBus :selected").each(function(i, selected){

     isValid = isValid || $(selected).val().length;

    });

    if(isValid) {

     $("#sDiv :selected").each(function(i, selected){

      $(selected).removeAttr("selected");

     });

    }

   }

  </script>


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>