Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->addElement('password', 'password', 'Password:', array('id'=>'id_password'));
- $this->addElement('checkbox', 'unmask', 'Unmask password:', '', array('onclick'=>'togglePasswordMask('id_password')', 'id'=>'id_passwordunmask'));
- $this->addElement('static', null, '',
- '<script type="text/javascript">
- //<![CDATA[
- function togglePasswordMask(id) {
- var pw = document.getElementById(id);
- var chb = document.getElementById(id+'unmask');
- var newpw = document.createElement('input');
- newpw.setAttribute('name', pw.name);
- if (chb.checked) {
- newpw.setAttribute('type', 'text');
- } else {
- newpw.setAttribute('type', 'password');
- }
- newpw.id = pw.id;
- newpw.value = pw.value;
- pw.parentNode.replaceChild(newpw, pw);
- }
- //]]>
- </script>');
Add Comment
Please, Sign In to add comment