Author: danydb
Date: 2012-10-01 23:09:46 +0200 (Mon, 01 Oct 2012)
New Revision: 429

Modified:
   trunk/tools/include/template/tool_exercice_input.php
Log:
Check data with javascript

Modified: trunk/tools/include/template/tool_exercice_input.php
===================================================================
--- trunk/tools/include/template/tool_exercice_input.php        2012-10-01 
20:59:56 UTC (rev 428)
+++ trunk/tools/include/template/tool_exercice_input.php        2012-10-01 
21:09:46 UTC (rev 429)
@@ -27,7 +27,7 @@
  *
  */
 ?>
-<form method="POST">
+<form method="POST" onsubmit="return validate()">
        <table>
                <tr>
                        <td>
@@ -66,4 +66,24 @@
 echo HtmlInput::submit('save','Valider');
 echo HtmlInput::request_to_hidden(array('sa','ac','plugin_code','gDossier'));
 ?>
-</form>
\ No newline at end of file
+</form>
+<script charset="UTF8" lang="javascript">
+       function validate()
+       {
+               if (trim($('<?=$exercice->id?>').value)=='') {
+                                               
$('<?=$exercice->id?>').style.borderColor='red';
+                                               alert('Exercice invalide');
+                                               return false;
+                                       }
+               if (trim($('<?=$nb_month->id?>').value)=='') {
+                                               
$('<?=$nb_month->id?>').style.borderColor='red';
+                                               alert('Nombre de mois 
invalide');
+                                               return false;
+                                       }
+               if (trim($('<?=$year->id?>').value)=='') {
+                                               
$('<?=$year->id?>').style.borderColor='red';
+                                               alert('Année invalide');
+                                               return false;
+                                       }
+       }
+</script>
\ No newline at end of file



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu

_______________________________________________
Phpcompta  est un logiciel libre de comptabilit&#233; en ligne 
(http://www.phpcompta.eu)
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev

Reply via email to