Hello,
I am a JSP newbie. I am trying to encode a password on a login form, before it is sent to the server. I created a test button to display the hashed password, but errors out with the message 'digestPswd not defined'
Here are the code snippits that I using to implement this functionality:
<webuijsf:head id="head1" title="Log In">
<script language='javascript' src='short_sha1.js' type='text/javascript'></script>
<script type='text/javascript' language='javascript'>
function digestPswd(){
var pswdField = document.getElementById('form1:pswdPswd');
var digestField = document.getElementById('form1:hiddenDigestedPswd');
var shaString = hex_sha1(pswdField.value);
pswdField.value = '';
digestField.value=shaString;
alert(shaString); //This for testing only
return false;
}
</script>
....... followed later by..... <input type="button" value="Click Here!" onclick="digestPswd();" />
Any help would be appreaciated.
Thanks,
Roger L.