cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject [CForms] Events in Javascript with Semicolon missing is OK?
Date Sun, 01 Feb 2004 00:30:50 GMT
Hi:

We are using some events in CForms and write them directly in the CForm
definition file. The problem is we noted sometimes it is no necesary to
write the ending semicolon ";" at the end of the instructions and the
cform works fine. Example:

<wd:on-value-changed>
  <javascript>
   ...

   if (pco_costo_w != null &amp;&amp; pco_montoAIT_w != null) {
     if (pco_costo_w != 0) {
       var porc_proyecto = (pco_montoAIT_w /  pco_costo_w) * 100;
       var monto_beneficiario = pco_costo_w - pco_montoAIT_w;
       var porc_beneficiario = 100 - porc_proyecto;
       proyecto.setValue(new java.math.BigDecimal(porc_proyecto));
       beneficiario.setValue(new java.math.BigDecimal(monto_beneficiario));
       ^^^^^^^
****** In the two lines above, if we miss the ending semicolon, everythink
works fine and no error is throw at all.

       ...
       } else {
       ...
       }
       ...
  }
  </javascript>
</wd:on-value-changed>

Everyone else noted this bug? Or is this a feature ;-)

Best Regards,

Antonio Gallardo

Mime
View raw message