Nothing happens when clicking the safe button


Posted by Phoenix - May 20 ’15 at 02:37

Hi there

I'v got a strange but important problem. I have several safe buttons. The standard safe and close buttons are working just fine. But the others do not safe the form. I have following code in the OnClick handler

var error = false;



var text = fd.field('Justification').control()._el().find('').text().replace(/\W/g, '');

if (text == '') {

msgError = "Please justify your decision!";

error = true;

} else {

error = false;



if (error == true) {


return false;

} else {

return true;



Although the alerts are appearing, nothing happens after that. I habe similiar buttons in other forms and there they are just working fine. I also tried to delete the buttons and create them again. Still no success.


Any ideas?

  • Dmitry Kozlov
    Dmitry Kozlov
    Member for: 9 years 3 days
    #1 by Dmitry Kozlov May 20 ’15 at 05:13


    I see just a single alert in your code and after that it returns false, so the form will not be submitted after the alert.

  • Phoenix
    Member for: 7 years 9 months 16 days
    #2 by Phoenix May 22 ’15 at 12:49

    [#1]: Yeah, well it returns only an alert if there is an error, if not it should return true and then  submit. Or am I wrong?

  • Phoenix
    Member for: 7 years 9 months 16 days
    #3 by Phoenix May 22 ’15 at 02:06

    I'm so sorry. My fault, I accidentaly use a button instead of a safe button. Sorry for bothering and thanks for helping

Displaying 1 to 3 of 3 messages