Launching a jQuery Event from a Plugin on Checkbox Change -


i have following code:

      <script>         $('#switch-1:checkbox').change(function() { if (this.checked) {       $('#generatepassword').pgenerator({'uppercase': true}); } else {       $('#generatepassword').pgenerator({'uppercase': false}); } };       </script>  

when checkbox checked or unchecked, want change parameters of plugin, goal generate password. in case i'm trying set parameter uppercase false or true depending if checkbox checked or not.

how write code sends parameters plugin upon event of checkbox click?

try this:

$('#switch-1').click(function() { if($(this).prop('checked') == true) {     $('#generatepassword').pgenerator({'uppercase': true}); } else {     $('#generatepassword').pgenerator({'uppercase': false}); } }; 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -