JqGrid - password confirmation

I want to do a simple thing: I want to compare data from two input fields. I mean: the user will fill in the field with his password, and another field will appear asking you to enter his password again. I want to compare these two data to make sure they match. My problem is that I don’t know how to get the data from the confirmation field to compare it. The relevant part of the code is here (confirmaSenha is a confirmation field):

{name:'senha', width:80, sortable:true, editable: true, hidden:true, edittype:'password', editrules:{edithidden:true, required:true, custom:true, custom_func:validaSenha}},
{name:'confirmaSenha', width:80, sortable:true, editable: true, hidden:true, edittype:'password', editrules:{edithidden:true, required:true}},

function validaSenha(value, colname){               
    if (colname=='senha' && value == HOW_DO_I_GET_DATA_FROM_CONFIRMATION_FIELD?) {
        return [true, ""];
    }
    else {
        return [false, ""];
    }
}

edited

if ((colname == 'senha') && (value == $('#tr_confirmaSenha').val())) {
        alert('true');
        return [true, ""];
    }
    else {          
        var senha = $("#tr_confirmaSenha").val();                
        alert(senha);
        $("td.editmsg", 'FrmGrid_grid').html("Senhas diferentes.");
        return [false, ""];
    }
}

Thanks in advance.

0
source share
1 answer

According to the first post in the discussion section http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules

. dataevents editOptions, , .

editoptions: { size: 1,
               dataUrl: 'Includes/tblJobSelect.php',
               dataEvents: [
                  {  type: 'change',
                     fn: function(e) {
                        $('input#Job_Number').val(this.value);
                     }
                  }
               ]
},

  $('input#Job_Number')

Job_Number

confirmaSenha

  $('input#confirmaSenha')

firebug - , , . , , , . ,

  $('input#confirmaSenha')

, , . , , , , . , , .

0

All Articles