form.send doesn't firing php

Hello

In my project i have

myForm.attachEvent("onButtonClick", function(id){ if(id == 'send') myForm.send("/api/central/sms", function(loader, response){ myForm.progressOff(); }); })

and works without any problem. However, following code is not firing.

SignupForm.attachEvent("onButtonClick", function(id){ if(id == 'send') SignupForm.send("/api/signup/save", function(loader, response){ SignupForm.progressOff(); }); })

is there any idea why first code works but almost identically same code doesn’t?

Hi

code means all code or send or progressOff?

I don’t understand you meant but i want trigger/fire a method named save() in singup.php
but first chunk of code works as it should unfortunately SignupForm.send doesn’t trigger/fire signup.php

then probably id is not ‘send’, check you form struct?

Here is complete (non-working) code

[code]SignupForm = Signup.attachForm();
formData = [
{“type”:“settings”,“position”:“label-top”,“labelAlign”:“left”},
{“type”:“block”,“width”:200,“blockOffset”:10,“list”:[
{“type”: “input”, “name”:“user_name”, “label”: “First and Lastname”,“required”:true,“inputWidth”:190},
{“type”: “input”, “name”: “user_mail”, “label”: “E-mail”,“required”:true,“inputWidth”:190},
{“type”: “input”, “name”: “user_cell”, “label”: “Cell Phone”,“required”:true,“inputWidth”:190},
{“type”: “password”, “name”: “user_pass”, “label”: “Password”,“required”:true,“inputWidth”:190},
{“type”:“button”,“name”:“send”,“value”:“Create Account”}
]
}
];
SignupForm.loadStruct(formData,“json”,function(){ Signup.progressOff(); });
SignupForm.setItemFocus(‘user_name’);

SignupForm.attachEvent(“onButtonClick”,function(id)
{
Signup.progressOn();
SignupForm.send("/api/signup/save", function(loader, response)
{
Signup.progressOff();
json_res = JSON.parse(response);

		if(json_res['status']=='ERROR')
            dhtmlx.alert({ title:"Error!!!",type:"alert-error",text:json_res['error_message'] });
        else if(json_res['status']=='OK')
            dhtmlx.message({text: "Account created" });
    });

});
[/code]

Hi

send() before real send call validate() inside. if validation isn’t success - operation aborted. the best way to get completed demo from you. please send it to support at dhtmlx dot com if it pro.