conditional formatting for form input, when user enters wrong input

  • 28 March 2019
  • 2 replies
  • 20 views

Badge +4

hi there,

 

2 questions:

1. does anyone know of a good post for conditional formatting when entering information on a form? based on a boolean value for example? 

2. is there a way to calculate and display the length of a field as a user is entering the information?

 

My situation connects the two questions:

Users are required to enter a 11 digit customer number which may contain zeroes at the front, so I want to show them as they are typing how many characters they have entered. My experience when collecting the data via spreadsheets is they often submit 10 digits either intentionally or unintentionally omitting the zero, so my manager wants to draw it to their attention this way.

I've used a calculated value control with the formula:

 

length(InputControlName)

 

I've set

Recalculate formula on view mode: Yes

Recalculate formula on new mode: Yes

Recalculate formula on edit mode: Yes

 

However when I go into the form, 

@emha this is an example of the "does it calculate now / when does it calculate?" question I was alluding to on the other post which you answered (and I'm still working my way through to answer properly, so please don't think i've not appreciated the time taken to answer my question).

 

It is not clear for someone coming from an excel background like me 'when stuff happens' which i know is terribly vague but just trying to get a handle so i stop pestering everyone. 


2 replies

Badge +4
and also does Preview mode show live calcs?
Userlevel 5
Badge +14
1. does anyone know of a good post for conditional formatting when entering information on a form? based on a boolean value for example? 

 

yes, formatting rule can be based on boolean value (eg. Yes/No check box control). 

in fact, rule's formula has always evalaute to boolean true/false value. if it doesn't, it's automatically converted to boolean value.

but the question is very general, I'm not sure what's exactly you'd like to implement

 

 

 

2. is there a way to calculate and display the length of a field as a user is entering the information?

 

yes, it's possible.

easiest way to implement is to use calcu;ated value control, as you did. it evaluates immediatelly once (any of) a field the formula depends on is changed (efectivelly: when the value is changed and control lost focus). I think this might be sufficient in your scenario.

 

if you'd like to recalculate on each keystroke, you'd need to write a javascript for that.

see eg. https://community.nintex.com/t5/Community-Blogs/Nintex-Forms-how-to-limit-maximum-length-of-input-field-during/ba-p/80315

 

 

along with visual 'alarm' to notify something is not inputted as expected, do not forget to implement a validation (validation rule, control's validation...) . formatting rule nor any notification made with javascript do nor prevent submitting incorrect input.

 

 

 

However when I go into the form, 

 

I've a feeling you wanted to continue with this....

 

 

 

 

so please don't think i've not appreciated the time taken to answer my question

 

no problem :smileyhappy:

 

 

 

 

and also does Preview mode show live calcs?

 

yes, preview performs calculations for calculated value controls, formatting and validation rules.

... as far as these do not depend on a value that's only available in runtime (eg. list fields value)

 

 

 

Reply