View Full Version : convert password field before form.submit

23 Apr 2007, 1:23 AM
I have a password field that I want to convert to a more secure string before POST submit.
I tried some code that you can se below. The problem I have with this code is that i end up with two FORM NAME "password" and "password". One is generated from Ext.lib.Ajax.formRequest and the other generated from Action.getParams(). Do anyone know how I can make this work?

myForm.on('beforeaction', function(form, action) {
var passwordValue = form.items.item(1).getValue();
form.baseParams = {};
form.baseParams['password'] = hex_md5(passwordValue + key);

24 Apr 2007, 7:06 AM
This should work, I'm currently doing something almosy identical.

myForm.on('beforeaction', function(form, action) {
var item = form.items.item(1);
item.setRawValue( hex_md5( item.getValue() + key ) );