← Back to team overview

dhis2-devs team mailing list archive

Re: Javascript on custom forms

 

Hi Conrad,

good point. Can you please use chome, click F12 -> console, and post any
errors that appear there while running the report?

Lars



On Sat, Sep 7, 2013 at 10:22 AM, conrad muyepa <cmuyepa@xxxxxxxxx> wrote:

> I added a java script code below on custom form, its working (on data
> entry module)  but am failing  to run a data set report ; it says "please
> wait".
> Other forms which do not have java scripts am able to run a data set
> report. I have tried to clear browser cache, cache inside dhis2, and even
> tried to
> reboot my server but still not working . I have attached a log file and a
> data set photo for your help.
>
> <script>
>
>   onValueSave( function( event, dataValue ) {
>
>   var va = dataValue.value;
>
>   var pregnancyTotal =
> document.getElementById('indicatorKjQQ3pfzqrd').value;
>
>   var ageTotal = document.getElementById('indicatorQms7PKJLmuO').value;
>
>
>
> if(ageTotal == pregnancyTotal)
>
> {
>
>
> document.getElementById('indicatorKjQQ3pfzqrd').style.backgroundColor="white";
>
>
> document.getElementById('indicatorQms7PKJLmuO').style.backgroundColor="white";
>
>   }
>
> else
>
> {
>
>
> document.getElementById('indicatorQms7PKJLmuO').style.backgroundColor="red";
>
>   }
>
> // Modify the form based on the data element and value being saved
>
> } );
>
>
>
> </script>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>

References