egroupware/calendar/templates/default/edit.tpl

106 lines
2.9 KiB
Smarty
Raw Normal View History

2000-11-23 02:37:50 +01:00
<!-- $Id$ -->
<!-- BEGIN edit_entry_begin -->
<script language="JavaScript">
// do a little form verifying
function validate_and_submit() {
if (document.addform.name.value == "") {
alert("{name_error}");
document.addform.name.select();
document.addform.name.focus();
2000-11-23 02:37:50 +01:00
return false;
}
2000-12-06 13:15:45 +01:00
sh = parseInt(document.addform.hour.value);
sm = parseInt(document.addform.minute.value);
if (sh < 0 || sh > 23) {
alert ("{time_error}");
document.addform.hour.select();
document.addform.hour.focus();
return false;
}
2000-12-06 13:15:45 +01:00
if (sm < 0 || sm > 59) {
alert ("{time_error}");
document.addform.minute.select();
document.addform.minute.focus();
return false;
2000-11-23 02:37:50 +01:00
}
2000-12-06 13:15:45 +01:00
eh = parseInt(document.addform.end_hour.value);
em = parseInt(document.addform.end_minute.value);
if (eh < 0 || eh > 23) {
alert ("{time_error}");
document.addform.end_hour.select();
document.addform.end_hour.focus();
return false;
}
2000-12-06 13:15:45 +01:00
if (em < 0 || em > 59) {
alert ("{time_error}");
document.addform.end_minute.select();
document.addform.end_minute.focus();
return false;
}
2000-12-06 13:15:45 +01:00
// so = parseInt(document.addform.month.value);
// sd = parseInt(document.addform.day.value);
// sy = parseInt(document.addform.year.value);
// eo = parseInt(document.addform.end_month.value);
// ed = parseInt(document.addform.end_day.value);
// ey = parseInt(document.addform.end_year.value);
// if (sy == ey && so == eo && sd == ed) {
// if (sh > eh) {
// alert ("{time_error}");
// document.addform.end_hour.select();
// document.addform.end_hour.focus();
// return false;
// }
// if (sh == eh && sm > em) {
// alert ("{time_error}");
// document.addform.end_hour.select();
// document.addform.end_hour.focus();
// return false;
// }
// }
// if (sy == ey && so == eo && sd > ed) {
// alert ("{date_error}");
// document.addform.end_day.select();
// document.addform.end_day.focus();
// return false;
// }
// if (sy == ey && so > eo) {
// alert ("{date_error}");
// document.addform.end_month.select();
// document.addform.end_month.focus();
// return false;
// }
// if (sy > ey) {
// alert ("{date_error}");
// document.addform.end_year.select();
// document.addform.end_year.focus();
// return false;
// }
2000-11-23 02:37:50 +01:00
// would be nice to also check date to not allow Feb 31, etc...
document.addform.submit();
// return true;
2000-11-23 02:37:50 +01:00
}
</script>
</head>
<body bgcolor="#C0C0C0">
<center>
<h2><font color="#000000">{calendar_action}</font></h2>
<form action="{action_url}" method="post" name="addform">
{common_hidden}
<table border="0" width="75%">
<!-- END edit_entry_begin -->
{output}
<!-- BEGIN edit_entry_end -->
</table>
2000-12-06 13:15:45 +01:00
<input type="button" value="{submit_button}" onClick="validate_and_submit();">
<noscript><input type="submit" value="{submit_button}"></noscript>
2000-11-23 02:37:50 +01:00
</form>
{delete_button}
</center>
<!-- END edit_entry_end -->