Nothing happens when clicking the safe button

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Phoenix
Posts: 23
Joined: Wed Dec 10, 2014

20 May 2015

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?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

20 May 2015

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.

Phoenix
Posts: 23
Joined: Wed Dec 10, 2014

22 May 2015

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
Posts: 23
Joined: Wed Dec 10, 2014

22 May 2015

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

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests