Changeset 3032

Show
Ignore:
Timestamp:
10/10/06 22:56:49 (18 years ago)
Author:
jerome
Message:

Added some javascript form validation code to avoid common mistakes
and incompatibilities between output format and data type.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/cgi-bin/dumpykota.cgi

    r3030 r3032  
    4242    <title>%s</title> 
    4343    <link rel="stylesheet" type="text/css" href="/pykota.css" /> 
     44    <script type="text/javascript"> 
     45    <!-- 
     46      function checkvalues()  
     47      { 
     48          if ((document.mainform.format.value == "cups") && (document.mainform.datatype.value != "history")) 
     49          { 
     50              alert("Output format and data type are incompatible."); 
     51              return false; 
     52          } 
     53           
     54          if (document.mainform.sum.checked && (document.mainform.datatype.value != "payments") && (document.mainform.datatype.value != "history")) 
     55          { 
     56              alert("Summarize is only possible for History and Payments."); 
     57              return false; 
     58          } 
     59           
     60          if (document.mainform.sum.checked && (document.mainform.format.value == "cups")) 
     61          { 
     62              alert("Summarize is not possible with CUPS' page_log format."); 
     63              return false; 
     64          } 
     65           
     66          return true; 
     67      } 
     68    //--> 
     69    </script> 
    4470  </head> 
    4571  <body> 
    4672    <p> 
    47       <form action="dumpykota.cgi" method="GET"> 
     73      <form action="dumpykota.cgi" method="GET" name="mainform" onsubmit="return checkvalues()"> 
    4874        <table> 
    4975          <tr> 
  • pykota/trunk/NEWS

    r3030 r3032  
    2424    - 1.25alpha13 (2006-10-04) : 
    2525      
     26        - The dumpykota.cgi script now does basic form checking 
     27          to immediately avoid incompatible dump options and 
     28          alerts the end user if Javascript is enabled. 
     29           
    2630        - The filter keys in dumpykota can now be specified in 
    2731          lower or upper case.