phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r429 - trunk/tools/include/template


From: phpcompta-dev
Subject: [Phpcompta-dev] r429 - trunk/tools/include/template
Date: Mon, 1 Oct 2012 23:09:46 +0200 (CEST)

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



reply via email to

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