how do i change the border of list lookup to red to show incorrect input?


Badge +2

if(fromShortcode.val() == toShortcode.val()){
 alert('same values entered in both the field!');
 NWF$(shortCode).addClass('border-red');
 }
 else
     {
      NWF$(shortCode).removeClass("red-border");
     }
  });
});

this is te code I have written where if the 'if' condition gets true then the list lookup field(shortCode) is to be set to red border or it should remain black itself


6 replies

Userlevel 5
Badge +14

use validation rules to check whether inputs meet your requirements.

if validation doesn't pass through respective controls will be automatically highlighted.

Badge +2

Yes thank you for the reply, the validation rules work when the form gets submitted.

while solving it I tried doing that in real time (i.e before submitting the form) using JavaScript and CSS and it worked for me.

I'm sharing the code as it can be helpful to someone.

NWF$(".border").css({"border-color": "#FF0000",
             "border-width":"3px",
             "border-style":"solid"});

the above code goes in the custom JavaScript field

And in the 'control CSS class' of the field u want to highlight(which you will get in the formatting field in settings)u have to name it border.

Userlevel 5
Badge +13

Hi all,

 

Our UX team are doing some research into our style builder for Universal Forms. We would appreciate your feedback on your current experience in styling your forms in any platform.

 

If you would like to provide feedback, please fill out the survey at Applying styles in Nintex Forms 

 

Thanks,

Euan

Badge +2
Ever have to change the color of the highlighted field on a form for color blind end-users? I'm looking for help there... I've changed the color or error messages easily, but haven't found the right code for changing the border color on highlight whenever a validation rule is triggered. Help! thanks! :)
Badge +1

Hi @cbennett1 this is Fab and I work as a User Experience designer for Nintex Forms and Mobile. I am currently working on a new experience for form styling that we will introduce across Universal Forms. Can I ask as to what version of Nintex forms you are currently designing in? 

Hope to hear from you soon and Kind Regards. 

Fab. 

Badge +2
Hi FabioLiberatore... About to upgrade to the latest greatest, but current on Version: 4.3.1.0...

Reply