Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//generate the javascript content of method cloudpassSetUsername to inject into the current page
function injectSetUsernameFunc(usernameFieldIsId,usernameField){
var js = 'window.cloudpassSetUsername = function(username){';
js += 'forceChangeField( document.getElementById("'+usernameField+'"), username);';
js += 'forceChangeField( document.getElementsByName("'+usernameField+'")[0], username);';
js += '};';
return js;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.