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

Can't apply color to certain fields using JS

Jump to solution

I have a date picker, single line text, drop down menu, people picker fields on my form.

When I click on a button it calls a method to highlight the border.

However it only works on the single line text and date picker fields.  

It is not working on the drop down and people picker fields. 

Ex: Department Name, Number, Submitted on Behalf Of

Code

Can anyone else replicate this issue?  

Tags (2)
Reply
3 Replies
lakshminarayana
Nintex Newbie

Re: Can't apply color to certain fields using JS

Jump to solution

Hi,

NWF$(document).ready(function()
{  
 NWF$('#'+text).css("cssText", "border-color: red");
NWF$('#'+date).css("cssText", "border-color: red");
NWF$('#'+dropdown).css("cssText", "border-color: red !important;");
NWF$('#'+people).closest('.nf-filler-control-border')[0].style.border='1px solid red'
});

Thanks,

Lakshmi

Reply
apham
Nintex Newbie

Re: Can't apply color to certain fields using JS

Jump to solution

@Lakshmi C Thank you.  Your tip was very helpful.  However when applied the code to the drop down menu, it applied the CSS to a hidden text box below the drop down menu instead of the drop down menu itself.  Do you know why I am not getting the same results as you?

0 Kudos
Reply
apham
Nintex Newbie

Re: Can't apply color to certain fields using JS

Jump to solution

I did some research and used the parentsUntil() method to apply the CSS to all ancestor elements on the drop down menu.  Afterwards, the CSS was applied to only the drop down menu and the text box was removed.

Reply