Ninja Form Custom Code

Please help to understand
mail@pastecode.io avatar
unknown
javascript
3 years ago
1.5 kB
3
Indexable
<script type="text/javascript">

/* Add your JavaScript code here.

If you are using the jQuery library, then don't forget to wrap your code inside jQuery.ready() as follows:

jQuery(document).ready(function( $ ){
    // Your code in here
});

--

If you want to link a JavaScript file that resides on another server (similar to
<script src="https://example.com/your-js-file.js"></script>), then please use
the "Add HTML Code" page, as this is a HTML code that links a JavaScript file.

End of comment */ 



jQuery(document).on('nfFormReady', function() {
  console.log("ninja form ready");
  
  function checked_value(){
     jQuery('input[type=checkbox]').change(function() {
        jQuery(".check_box_checked textarea").val("");
           setTimeout(function(){ 
                   jQuery('.nf-checked-label').each(function () {

                      var txt = jQuery(this).text();
                      // var count = jQuery(this).text();
                   //  console.log(count); 
                     jQuery("div#checkedd").html(txt);
                     jQuery(".check_box_checked textarea").val(jQuery(".check_box_checked textarea").val() + txt + '<br>');
                     //jQuery("textarea#nf-field-319").val(txt);
                });     }, 100);
      });
  }
  
  
  checked_value();
  var count = "3" ;
  nfRadio.channel( 'nfMP' ).on('change:part', function() {
   console.log("[nfMP] change:part");
    
   checked_value();
    
   });
});
</script>