cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
joni
Nintex Newbie

How to add border to input control in display mode?

Hi - I'd like to add a border, not background color, to input controls in display mode only. Does anyone know how to do that? If adding to custom css, what is the syntax to capture display mode only?

Thank you!

Joni

0 Kudos
Reply
14 Replies
emha
Nintex Newbie

Re: How to add border to input control in display mode?

it's possible eg. following way

NWF.FormFiller.Events.RegisterAfterReady(function () { 
    if (Is Display Mode){
        NWF$('#'+varBorderCtrl).closest('.nf-filler-control-border').css('border-style','solid');
    }
})
0 Kudos
Reply
joni
Nintex Newbie

Re: How to add border to input control in display mode?

Thank you for responding. I added this to my form but it only resulted in timing out whenever I tried to view an item from either the Preview icon within Nintex, or from an existing item in the SharePoint list.

Joni

0 Kudos
Reply
emha
Nintex Newbie

Re: How to add border to input control in display mode?

Have you just copy-pasted it and nothing more?

I've had assumed you understood what's going on in there.

What I guess could be a problem:

1. hopefully you have placed the code from above into custom javascript, not into custom css

2. make sure "Is Display Mode" is not placed there as a plain text but rather inserted as a reference

3. make sure you defined javascript variable for the control to be bordered  (varBorderCtrl in my example)

0 Kudos
Reply
joni
Nintex Newbie

Re: How to add border to input control in display mode?

Obviously I am a newbie to using JS with Nintex. I added the code to Custom JS, not custom CSS, and replaced the Is Display Mode with the reference. But I do not know where to define the variable - is that in the Custom JS field as well?

Thank you,

Joni

0 Kudos
Reply
emha
Nintex Newbie

Re: How to add border to input control in display mode?

Open configuration dialog for respective control  (double click on it)

at the very bottom there will be advanced section

within it you will find an option to define javascript variable

Sorry, I'm not able post a screenshots right now

0 Kudos
Reply
joni
Nintex Newbie

Re: How to add border to input control in display mode?

I had already tried defining the variable in the advanced settings as you advised but, because the wrong behavior persisted, I assumed I'd done something incorrectly. Based on your feedback I added it correctly, but I must be doing something wrong as the display mode continues to freeze on "Please wait" without ever resolving. This is true from Preview in the Nintex form and from View Item on the SP list item. (In case it makes a difference, the test list consists of two Single Lines of Text fields, super simple.)

0 Kudos
Reply
joni
Nintex Newbie

Re: How to add border to input control in display mode?

Screen shots of Nintex code input

0 Kudos
Reply
emha
Nintex Newbie

Re: How to add border to input control in display mode?

ups, my bad!

I've tested with calculated value control which I was sure doesn't have any border in any mode. I haven't realized some controls do not get created javascript variables in display mode.

anyway, even the previous code doesn't do what's expected, it shouldn't cause any freezing...

for single line text control try following:

- if you do not need it for other purposes, remove javascript variable from control configuration

- define a class for the control, eg. borderCtrlClass

- change javascript code to the following

NWF.FormFiller.Events.RegisterAfterReady(function () { 
    if (Is Display Mode){
        NWF$('.borderCtrlClass').find('.nf-filler-control-border').css('border-style','solid');
    }
})‍‍‍‍‍
Reply
joni
Nintex Newbie

Re: How to add border to input control in display mode?

I really appreciate your help! Unfortunately this is still causing the preview to sit on "Please wait" indefinitely. Something so seemingly simple is so difficult!

0 Kudos
Reply