setCustomValidity is not a function

Pulling out a Wappler project that hasn’t seen several iterations of updates and receiving this error when attempting to submit a form:

It triggers even if all inputs have values.

@patrick @George @Teodor Can you guide me to troubleshooting this?

We saw this in one of our projects, but unfortunately I don’t at all remember where it was coming from and how we fixed this.
It was also on one of the older projects that we updated to v3.x I think.
Will update here if I recollect what we did.

@patrick This seems to have your name on it…can you advise?

The error is that it probably tries to validate a node that is not a valid form element. From the stacktrace I see that it detects a checkbox/radio input and then it gets the nodes with the same name from which it picks the first node to use for the validation. Is it possible that you have a checkbox on your page with the same name as some other element. I will improve code so that it only looks for inputs inside the current form. Will post an update here later.

Thanks…that helped me solve the issue. Much appreciated!

The long of it in case it helps you…

I had the following that is not inside a form which is used for a server connect filter:


	<div class="form-group" id="order_status" is="dmx-checkbox-group" name="order_status">
		<div class="form-check" dmx-repeat:repeat1="page_load.data.all_status">
			<input class="form-check-input order_status_check" type="checkbox" value="" dmx-bind:id="order_status_{{$index}}" name="order_status[]" dmx-bind:value="lookup">
			
		</div>
	</div>

And then 4 occurences of the following, each within their own form inside a modal:

<input class="form-check-input form-control-sm" type="radio" dmx-bind:id="inpute{{$index}}" name="order_status" dmx-bind:value="lookup" dmx-bind:checked="modal_add_order.current_order.value.order_status_lookup == lookup">

I renamed the form-group (and gave it a new id) and the error is gone.

I’ve updated the validator code that it only searches for the input within the elements from the current form.

dmxValidator.zip (5.2 KB)

Fixed in Wappler 3.9.5

This topic was automatically closed after 2 days. New replies are no longer allowed.