Conversational Forms and Advanced Number Field Add-on

I have an annoying edge case incompatibility when combining a conversational form with the Advanced Number Field Add-on by GravityWP.

I have a range value with a max value that is calculated using values from an earlier field. However this max value isn’t updated in the field validation. and results in the field failing validation even though the max attribute is actually higher than zero.

“This value should be less than or equal to 0 000 kr”

rather illogically, I had hoped aligning the element DOM value and data-slidervalues might help.
(pardon the split, units are in thousands of KR)

gform.addAction( 'gform_input_change', function( elem, formId, fieldId ) {
   if (elem.type == "range" && elem.id == "input_1_74") {
       const sliderValue = elem.getAttribute('data-slidervalue');
       if (sliderValue) {
           const valueParts = sliderValue.split(' ');
           if (valueParts.length > 0) {
               elem.value = valueParts[0];
	       elem.setAttribute('value', valueParts[0]);
           }
   }
}, 10, 3 );

What I actually need is some way to update the max value in the validation filter when/after the attribute is calculated.

I’ve been stumped for a while now, any suggestions?
Edit for clarification: This issue only happens in conversational views. max values are correctly evaluated for validation when rendered normally.

Several months ago I had a conversation with the ANF add-on support regarding this: here’s what they had to say:

“This seems to be a limitation in the Conversational forms addon. The range is being calculated on the server side. The issue here is that the conversational forms addon only submits the current visible field value to the server when moving to the next field. Therefore, the range validation has no knowledge of the value of the fields that were filled in previous steps. I suggest you reach out to Gravity Forms, maybe they can include the values that were entered in the previous fields in the server request when the user goes to the next field.”

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.