diff --git a/include/anc_od.inc.php b/include/anc_od.inc.php index 02fe6afef..dca8c9662 100644 --- a/include/anc_od.inc.php +++ b/include/anc_od.inc.php @@ -139,7 +139,7 @@ if ( isset($_GET['new'])) $wSubmit=new IHidden("p_action","ca_od"); $wSubmit->table=0; echo '
'; - echo '
'; + echo ''; echo dossier::hidden(); echo $wSubmit->input(); echo $a->form(); @@ -153,6 +153,31 @@ if ( isset($_GET['new'])) '; echo '
'; + $msg_comment=_("Commentaire vide"); + $msg_date=_("Date invalide"); +echo << + function validate_anc(p_frm_id) { + console.debug($(p_frm_id)['pdate'].value ); + try { + if ($('pdesc').value.length==0) { + smoke.alert('$msg_comment'); + return false; + } + if ( ! check_date($(p_frm_id)['pdate'].value) ) { + smoke.alert('$msg_date'); + return false; + } + } catch (e) { + smoke.alert(e.message); + } + return true; + } + +; + +EOF; + return; }