Skip to content

Instantly share code, notes, and snippets.

@gohrco
Last active May 16, 2016 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gohrco/086a1d0e43a1b45482ba133f2cd5b5b1 to your computer and use it in GitHub Desktop.
Save gohrco/086a1d0e43a1b45482ba133f2cd5b5b1 to your computer and use it in GitHub Desktop.
Add AutoComplete to WHMCS Admin Forms
<?php
/**
* Function to add hidden text / password fields for autofillers to use instead
*/
add_hook( 'AdminAreaHeadOutput', 1, function( $vars ) {
return <<< HTML
<input type="text" style="display:none">
<input type="password" style="display:none">
HTML;
});
/**
* Function to apply autocomplete="off" to input fields
*/
add_hook( 'AdminAreaFooterOutput', 1, function( $vars ) {
return <<< HTML
<script type="text/javascript">
jQuery(document).ready( function() {
jQuery('input').attr('autocomplete','off');
});
</script>
HTML;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment