Nothing happens when clicking the safe button
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;
fd.field('status').value('3b');
var text = fd.field('Justification').control()._el().find('div.ms-rtestate-write').text().replace(/\W/g, '');
if (text == '') {
msgError = "Please justify your decision!";
error = true;
} else {
error = false;
}
if (error == true) {
alert(msgError);
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?
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;
fd.field('status').value('3b');
var text = fd.field('Justification').control()._el().find('div.ms-rtestate-write').text().replace(/\W/g, '');
if (text == '') {
msgError = "Please justify your decision!";
error = true;
} else {
error = false;
}
if (error == true) {
alert(msgError);
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
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
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.
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.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 22 guests