i am going to ask a very old depreciated feature b...
# cfml-general
g
i am going to ask a very old depreciated feature but i do not have a choice right now, so what i am doing is to use the cfinput type="text" and use the regexd validation to validate date like a us date or euro date but should be in dd/mm/yyyy or mm/dd/yyyy and the alert to be shown right after the input property changed just like onpropertychange but for all browsers this is a more kind of javascript code but devs already using cfinput
p
Let them leave it as a "cfinput" but throw an ID or CLASS on there and write out some quick javascript/jquery to do the job. I mean its not difficult to remove
cf
from the front of
cfinput
😂
g
correct, but if its being used why not use pattern and validate stuff which is already present to us The major problem now is to detect onpropertychange on that input field, and i think ven if i change to use input instead of cfinput, the problem still remains
p
Havent used this in prob 10+ years but I can bet it is not compatible for any browser like jquery. https://cfdocs.org/cfinput
j
Can't you use a HTML5 date input? It's 2022 don't use cfinput 🙂 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
💯 3
p
And appears to trigger that validating you use
validateAt="onBlur"
g
hmm, i removed cfinput and then tried this
Copy code
<input type="text" name="FromDate" value="01/12/2022" id="Strtcalfield1" required="yes" message="Please enter date (mm/dd/yyyy)." pattern="[0-9]{2}-[0-9]{2}-[0-9]{4}">
now the issue is, if i hange the value in the input field from 01/12/2022 to 1/12/2022, it fails but if i change it back to 01/12/2022, it keeps showing the error, so how should it deduct the change i did manually in the field
👍 1
fixed, i did with jquery and regex
3