Foros de discusión

[solved]Problem with aui datepicker & validation

thumbnail
delang j, modificado hace 7 años.

[solved]Problem with aui datepicker & validation

Expert Mensajes: 252 Fecha de incorporación: 14/07/08 Mensajes recientes
i did some validation on date. for input date, im using aui datepicker. code as follow.
but the problem is, error message keep showing "Please enter a valid date."


AUI().use('aui-datepicker', function(A) {
	    var ta = new A.DatePicker({
		    trigger: '#<portlet:namespace />tarikh',
		    mask: '%d/%m/%Y',
		    calendar: {
				dateFormat: '%d/%m/%Y'
		    },
		    popover: {
	       		zIndex: 1
	   	 	}
	    });
	});

<portlet:namespace />tarikh: {
		required: true
	}

<portlet:namespace />tarikh: {
	   required: '<liferay-ui:message key="error_req" />'
	},


im on liferay 6.2 ge 6
windows 10

please help me how to fix this problem.
tq
thumbnail
delang j, modificado hace 7 años.

RE: Problem with aui datepicker & validation

Expert Mensajes: 252 Fecha de incorporación: 14/07/08 Mensajes recientes
updated.
<portlet:namespace />tarikh: {
		required: true,
		date: false
	},


when i added 'date:false', another wierd thing happen which is i need click the date picker twice to make error message gone.
thumbnail
delang j, modificado hace 7 años.

[solved]RE: Problem with aui datepicker & validation

Expert Mensajes: 252 Fecha de incorporación: 14/07/08 Mensajes recientes
look like problem came from 'cssClass' attribute. just remove it and 'please enter valid date' message gone.