Lara, The plan was to have an equivalent getValue, setValue and getField functions for encounterDate in the 1.9 release, but currently only getValue is working, I was thinking of putting off getting setValue and getField to work for dates until a later release (see HTML-205, and particularly the comments near the end) but will work to get this in this release since you need it and as it turns out I think not having that functionality may be a blocker for fixing HTML-297.
I will take a look when I get back from vacation later this week... Mark ________________________________________ From: [email protected] [[email protected]] On Behalf Of Darius Jazayeri [[email protected]] Sent: Monday, February 20, 2012 11:36 AM To: [email protected] Subject: Re: [OPENMRS-DEV] HTML Form Entry capturing changes in encounter date Hi Lara, FYI, the date field is actually going to change in the next HFE release, so it will be handled directly by HFE, instead of doing showCalendar. The new version will have a visible text field that shows dates in a user-friendly format, and a hidden input that stores the actual value as yyyy-mm-dd. You ought to be able to do a .change jquery listener as you'd expect, though. -Darius On Mon, Feb 20, 2012 at 5:56 AM, Lara Kellett <[email protected]<mailto:[email protected]>> wrote: 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]<mailto:[email protected]> with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]<mailto:[email protected]>?body=SIGNOFF%20openmrs-devel-l] ________________________________ Click here to unsubscribe<mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l> from OpenMRS Developers' mailing list _________________________________________ 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]

