← Back to team overview

dhis2-devs team mailing list archive

Re: custom HTML attributes missing when you open a custom form using the 'Event Capture' app

 

Hi Jose,

We just made a fix, to trunk, that keeps html attributes intact. Your
custom form should now work. Is it possible for you to test?

Thank you,
Abyot.


On Mon, Jun 16, 2014 at 2:43 PM, Jose Garcia Muñoz <josemp10@xxxxxxxxx>
wrote:

>
> (Sorry I forgot the subject in my last email)
>
> Dear dev community,
>
> PSI usually develops custom forms (both on the aggregated and tracker
> side) with script code in order to implement extra functionality ot get the
> control of some input html fields. For example we can introduce extra
> attributes or events in the HTML tags as follows (where 'custype' attribute
> and the 'onchange' event have been introduced using the html code editor)
>
> <input custype="age" id="fWJzMgoTWeU-VAGbWSzFIFg-val" name="entryfield"
> onchange="test()" title="[ VAGbWSzFIFg - TZ CC - Age - posInt ]" value="[TZ
> CC - Age]" />
>
>  Now in Data Entry, If we open the form using the  "old" 'Single Event
> Without Registration Managment' (under 'Individual Records'), we can see
> the code above re-written as:
>
> <input custype="age" id="fWJzMgoTWeU-VAGbWSzFIFg-val" name="entryfield"
> onchange="test()" title="[ VAGbWSzFIFg - TZ CC - Age - posInt ]" value=""
> tabindex="1" data="{compulsory:false, deName:'TZ CC - Age',
> deType:'posInt'}" options="false" maxlength="255" onkeypress="return
> keyPress(event, this)" class="inputText">   where all HTML attributes are
> there.
>
> However if we use the new 'Event Capture' app, we get the following code:
>
> <input type="number" name="VAGbWSzFIFg"
> ng-model="currentEvent.VAGbWSzFIFg"
> ng-required="programStageDataElements.VAGbWSzFIFg.compulsory"
> class="ng-valid-number ng-valid ng-valid-required ng-dirty">
>
> where all attributes and events are missing.
>
> Usually we get the control of HTML input fields using jQuery as follows:
> $("input[custype='age']"), so now using the Event Capture app we are not
> allowed to do that. Of course, we can use instead
> $("input[name='VAGbWSzFIFg']"), but this is more like a temporal solution
> (as it is not very readable and we cannot get the control of several DEs
> with the same attribute values).
>
> Any ideas/solutions?
>
> Thanks
> Jose
>
> _______________________________________________
> 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
>
>

Follow ups

References