noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 122/219: Anc ODS : check date is valid and co


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 122/219: Anc ODS : check date is valid and comment not empty
Date: Mon, 18 Dec 2017 13:22:48 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit d774be930b18cf14d71b5a0e0018c2f8feb78fb9
Author: Dany De Bontridder <address@hidden>
Date:   Wed Nov 1 12:02:48 2017 +0100

    Anc ODS : check date is valid and comment not empty
---
 include/anc_od.inc.php | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/include/anc_od.inc.php b/include/anc_od.inc.php
index 02fe6af..dca8c96 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 '<div class="redcontent"  >';
-    echo '<form method="post">';
+    echo '<form id="anc_od_frm" method="post" onsubmit="return 
validate_anc(\'anc_od_frm\');return false;">';
     echo dossier::hidden();
     echo $wSubmit->input();
     echo $a->form();
@@ -153,6 +153,31 @@ if ( isset($_GET['new']))
     ';
 
     echo '</div>';
+    $msg_comment=_("Commentaire vide");
+    $msg_date=_("Date invalide");
+echo <<<EOF
+<script> 
+    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;
+    }
+    
+</script>;    
+
+EOF;
+    
    return;
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]