jQuery UI Widgets › Forums › Plugins › Validator, Drag & Drop, Sortable › jqxValidator not working with jqxDateTimeInput
Tagged: #datetimeinput, #jqxdatetimeinput, custom rule, jqxvalidator, rule, validate, validate datetimeinput, validation rule, validator
This topic contains 4 replies, has 4 voices, and was last updated by Yavor Dashev 3 years, 3 months ago.
-
Author
-
Hello
I can’t get jqxValidator check a required jqxDatetimeInput.
See this example :$("#VIS_DATE").jqxDateTimeInput({ showTimeButton: false ,formatString: 'dddd dd MMMM yyyy' }); $('#testForm').jqxValidator({ hintType : 'label', animation: 'none', rules: [{ input: '#VIS_DATE', message: 'Date is required!', action: 'blur,valueChanged,keyup', rule: 'required'}, { input: '#emailInput', message: 'email is required!', action: 'blur', rule: 'required'} ] }); $("#jqxbutton").jqxButton({ theme: 'energyblue', width: 100, height: 30 }); $("#jqxbutton").click(function () { $('#testForm').jqxValidator('validate'); });
I guess the problem is #VIS_DATE is a widget, so I tried with the input that jqxDateTimeInput renames as #inputVIS_DATE but then display is a bit mesy when a required error is flagged.
How can I get a clean validation ?
Thank you
Lokodemo here : http://jsfiddle.net/eb8k6vnd/1/
Hello Loko,
jqxDateTimeInput can be validated using a custom jqxValidator rule, as shown in the following demo: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxvalidator/defaultfunctionality.htm?light.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/This still appears to be an issue. The above-referenced demo did not include the date widget. This example illustrates our issue, where date is nullable: http://jsfiddle.net/pauldare1/a2t64xsv/4/
Note: we tried changing the input reference to “inputjqxDate” but that resulted in an error (Uncaught TypeError: Cannot read property ‘nodeType’ of undefined) and the widget did not render
Hi pauld,
Unfortunately the issue is still present, but what I can suggest you is to check out our other UI library- SmartUI which also has a validator widget which supports the functionality you need.
Demo of the SmartUI validator: https://www.htmlelements.com/demos/validator/overview/
Let me know what you think!
Please, do not hesitate to contact us if you have any additional questions.
Best Regards,
Yavor Dashev
jQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.