/* validation errors */
-validate_notitle = "No title is set, continue?";
+validate_notitle = "No title is set, continue?";
+validate_invalid_startdate = "Incorrect startdate field!";
+validate_invalid_enddate = "Incorrect enddate field!";
2005-07-19 Helge Hess <helge.hess@opengroupware.org>
* UIxAppointmentEditor.wox: check whether title is set and raise a
- confirm panel if not
+ confirm panel if not, check if startdate/enddate are 10 chars long
2005-07-18 Helge Hess <helge.hess@opengroupware.org>
var e;
e = document.getElementById('summary');
- if (e.value.length == 0)
- return confirm('<var:string label:value="validate_notitle"/>');
+ if (e.value.length == 0) {
+ if (!confirm('<var:string label:value="validate_notitle"/>'))
+ return false;
+ }
+
+ e = document.getElementById('startTime_date');
+ if (e.value.length != 10) {
+ alert('<var:string label:value="validate_invalid_startdate"/>');
+ return false;
+ }
+
+ e = document.getElementById('endTime_date');
+ if (e.value.length != 10) {
+ alert('<var:string label:value="validate_invalid_enddate"/>');
+ return false;
+ }
+
+ // TODO: parse start/enddate and ensure that start is before end
+
return true;
}
</script>