Hi Everyone,

I am currently trying to write a html form that includes jquery functions to 
calculate some of the field values (it is a child height weight form that is 
calculating z-scores based on the height and weight entered for the child). 

Everything is working fine when you change the height or the weight fields, 
however I need to be able to detect when the encounter date field on the form 
is changed (so I can recalculate the values based on the child's age on the 
encounter date). I am struggling to get the jquery to do this to work. 
Currently the encounter date field renders as 

<input id="w1" type="text" onclick="showCalendar(this)" value="20/02/2012" 
name="w1" size="10" autocomplete="off">

the following jquery doesn't seem to work 

$('#w1').change(function() {
                alert("in change function");    
});

but a similar functions will work if I explicitly add a text field to the form.

For the other observation fields for height and weight I am using 
tags such as

<obs conceptId="$@WEIGHT_KG@" id="weight"/> 

then jquery 

getField('height.value').change(function() {
});

but there doesn't seem to be an equivalent function for the encounter date 
field.

Has anyone manged to write on change functions before for the encounter date 
field or has any suggestions on how I can get this to work?

Thanks,

Lara

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to 
[email protected] with "SIGNOFF openmrs-devel-l" in the  body (not 
the subject) of your e-mail.

[mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

Reply via email to