Page 1 of 1

Display Form Behavior

Posted: 12 Nov 2014
by schuess
Is there something special in Display Forms that would prevent code like this from executing?


if (fd.field('urgent').control()._el().find('input').prop('checked')){
alert("You have marked this request Urgent.");
$("#displayAlert").show();
};

Re: Display Form Behavior

Posted: 13 Nov 2014
by Dmitry Kozlov
Hello,

Yes, you can get only text representation of field values on display forms. So you should use the code below to retrieve the selected value:

Code: Select all

fd.field('urgent').control()._el().text()

Re: Display Form Behavior

Posted: 13 Nov 2014
by schuess
So if when using .input() i check for a .prop(),

what should i be checking for with .text() ?

Re: Display Form Behavior

Posted: 13 Nov 2014
by schuess
I figured it out with your help.

if (fd.field('urgent').control()._el().text() == "Yes"){