Client Side Date Input Validation

Win 10 Pro
Wappler 4.3.2
NodeJS

problem: min/max date validation is not working as expected on client side form submission.

code:

<dmx-datetime id="dateToday" interval="days"></dmx-datetime>
<form id="form1">
<input id="text2" name="text2" type="date" class="form-control" dmx-bind:min="dateToday.datetime.formatDate('yyyy-MM-dd')">
<button id="btn1" class="btn" type="submit">Button</button>
</form>

html at runtime:

<form id="form1" is="dmx-form" novalidate="">
<input id="text2" name="text2" type="date" class="form-control" is="dmx-input" value="" min="2021-12-01">
<button id="btn1" class="btn" type="submit" is="dmx-button" value="">Button</button>
</form>

error on form submission
image

html post form submission:

<form id="form1" is="dmx-form" novalidate="" class="was-validated">
<input id="text2" name="text2" type="date" class="form-control is-invalid" is="dmx-input" value="" min="2021-12-01">
<button id="btn1" class="btn" type="submit" is="dmx-button" value="">Button</button>
<div id="dmxValidatorErrorform1text2" class="invalid-feedback">Please enter a value greater than or equal to 2021-12-01.</div></form>

validator.js is on this version: @build 2021-11-25 16:51:09

same problem is possibly on max data validation as well.

What browser are you testing this in?
Also - is there a reason not to use the date picker component but a regular date input?

brave and edge - latest (both chromium based)

need to use native html input for better experience on mobile browsers.

A really old bug.

Please test this small update.

dmxValidator.zip (5.3 KB)

date validation works as expected now with this updated js file.
thank you.

This has been fixed in Wappler 4.4.2

This topic was automatically closed after 47 hours. New replies are no longer allowed.