Results 1 to 2 of 2

Thread: convert password field before form.submit

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    27
    Vote Rating
    1
      0  

    Default convert password field before form.submit

    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?


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

  2. #2
    Ext User haibijon's Avatar
    Join Date
    Mar 2007
    Posts
    105
    Vote Rating
    0
      0  

    Default

    This should work, I'm currently doing something almosy identical.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •