<form:input path="asEndDate" id="endDate" type="text" data-dojo-type="dijit.form.DateTextBox"
data-dojo-props="onChange: function() {dijit.byId('fromDate').constraints.max = arguments[0];
dijit.byId('asReviewStart').constraints.max = arguments[0];
dijit.byId('asReviewEnd').constraints.max = arguments[0];
}, required: true, constraints:{datePattern: '${datePattern}'}" />
error, issue, RnD, notes for my colleagues ... anything related with my job. A good programmer should be a good and fast reader. This log just to cut the costs of my RnD. Nothing personal :)
Showing posts with label dijit.form.DateTextBox. Show all posts
Showing posts with label dijit.form.DateTextBox. Show all posts
Tuesday, 18 December 2012
dijit.form.DateTextBox example
dojox.widget.DialogSimple: not validate while submit
gunakan dojox.widget.DialogSimple untuk 1 form. Dalam form ini ada dijit.form.DateTextBox dengan option required=true.
Apabila form ini dalam 1 page biasa, DateTextBox itu akan validated apabila submit.
Namun apabila form ini dimuatkan dalam DialogSimple, tiba2 sahaja validation tidak berfungsi (validation berlaku, namun form masih dihantar).
Penyelesaian:
Gunakan dojo form
<form:form name="aprSessionSetupForm" id="aprSessionSetupForm" modelAttribute="aprSession" action="${formMethod}" data-dojo-type="dijit/form/Form" >
kemudian tambah skrip
<script type="dojo/on" data-dojo-event="submit">
if(this.validate()){
return true;
}else{
return false;
}
return true;
</script>
Apabila form ini dalam 1 page biasa, DateTextBox itu akan validated apabila submit.
Namun apabila form ini dimuatkan dalam DialogSimple, tiba2 sahaja validation tidak berfungsi (validation berlaku, namun form masih dihantar).
Penyelesaian:
Gunakan dojo form
<form:form name="aprSessionSetupForm" id="aprSessionSetupForm" modelAttribute="aprSession" action="${formMethod}" data-dojo-type="dijit/form/Form" >
kemudian tambah skrip
<script type="dojo/on" data-dojo-event="submit">
if(this.validate()){
return true;
}else{
return false;
}
return true;
</script>
Subscribe to:
Posts (Atom)