Intercept dhtmlXForm.prototype.send to encrpt post parametrs

I am working on a project based on codeIgniter framework and I use dhtmlx to build my views. There is alot of forms in my project and I use myform.send most of the time, what I am trying to achieve is to write my own"send" function for the form - lets say mySend, this function is supposed to do some work before it calls the actual dhtmlx send function, something like this:

dhtmlXForm.prototype.mySend = function(args,..,doEencrypt) { //my code here //. //. //. // **** call the original form.send }

so later on I can do this

myform.mySend(myUrl, "post", doEncrypt,function (loader, response) {});

I am trying to do this because I want to do some changes on the form label names and values, this change is actually a simple encrypt for some of the form labels and their values, and I want to send an extra parameter to mySend function so I can choose which time to make the encryption

my questions are:
is what I am trying to do applicable ?
did I start right?
please help
thanks in advance :slight_smile:

here is what Ive got so far:

[code]dhtmlXForm.prototype.mySend = function (url, method, doEncrypt, callback) {
var originalForm = this,
formCopy = originalForm.getForm();
var validItemTypes = [‘hidden’, ‘input’, ‘combo’, ‘checkbox’, ‘radio’, ‘calendar’],
inputValue=’’;

formCopy.forEachItem(function (name) {
    if (validItemTypes.indexOf(formCopy.getItemType(name)) > -1)
    {
        inputValue = formCopy.getItemValue(name)+'abc';
        formCopy.setItemValue(name,inputValue);
    }
});
formCopy.send(url, method, callback);

};[/code]

this code is supposed to append “abc” to the value of each input of the form - just a simple change for a start -
the problem in this code that it changes the original form values and this change appears in the form view, how can I get a copy of the form ? or how can I construct a copy of the form with the same inputs that I need ? :question: :question:

Hello
Could you send us completed demo with detailed description of “what i have” and “what i expect” and link to this topic on support@dhtmlx.com?
docs.dhtmlx.com/auxiliary_docs__ … pport.html