Age Calculation From DOB - AGAIN


i have read ton of different ways age calculation work, think have javascript part down problem can not data show in age text field.<br />first field dob. (patient date of birth)<br />second field treatdate. (the date of treatment)<br />third field age. (patient age @ time of treatment)<br />i placed calculation in click event of age field intending have age populate after dob , treatdate entered , user clicks in age field.  (i tried calcualtion kick off other events nothing worked.)  tested changeing script type formcalc javascript, click in field formcalc warns me there problem. assume event correct.  here 1 tried, following shows xml field , javascript contained within it, think problem in getting data output page on click.  <br />// slashes added forum come out right.  <br /><br />//         <field access="readonly" h="9.525mm" name="age" relevant="-print" w="15.875mm" x="187.325mm"><br />//            <ui><br />//               <numericedit><br />//                  <border><br />//                     <?templatedesigner styleid aped3?><br />//                     <edge stroke="lowered"/><br />//                  </border><br />//                  <margin/><br />//               </numericedit><br />//            </ui><br />//            <font typeface="arial"/><br />//            <margin bottominset="1mm" leftinset="1mm" rightinset="1mm" topinset="1mm"/><br />//            <para valign="middle"/><br />//            <caption reserve="7.5869mm"><br />//               <font typeface="arial"/><br />//               <para valign="middle"/><br />//               <value><br />//                 <text>age</text><br />//               </value><br />//            </caption><br />            <br />//            <?templatedesigner scriptinitializers initialize::lang=javascript;click::lang=javascript;?><br />//            <value><br />//               <integer/><br />//            </value><br />//            <format><br />//               <picture>99999</picture><br />//            </format><br />//            <bind><br />//               <picture>99999</picture><br />//            </bind><br />//            <event activity="click"><br />//               <script contenttype="application/x-javascript"><br />               <br />//var date1 = new date(getfield("dob").value);<br />//var date2 = new date(getfield("treatdate").value);<br />//msperyear = 365*24*60*60*1000;<br />//var result = math.floor((date2-date1)/msperyear);<br /><br />//</script><br />//            </event><br /><br />//         </field><br /><br />the field there when enter dob , treatdate click in field nothing.  <br />i tried way basing on working "today's date" box created elsewhere in form.  <br /><br />//         <field h="9.525mm" locale="ambient" name="age"  w="15.875mm" x="187.325mm"><br />//            <ui><br />//               <numericedit><br />//                  <border><br />                    <br />//                     <edge stroke="lowered"/><br />//                  </border><br />//                  <margin/><br />//               </numericedit><br />//            </ui><br />//            <font typeface="arial"/><br />//            <margin bottominset="1mm" leftinset="1mm" rightinset="1mm" topinset="1mm"/><br />//            <para valign="middle"/><br />            <br />//          <caption reserve="7.5869mm"><br />//               <font typeface="arial"/><br />//               <para valign="middle"/><br />//               <value><br />//                  <text>age</text><br />//               </value><br />//            </caption><br />            <br />//            <value><br />//               <integer/><br />//            </value><br /><br />//            <bind match="none"><br />//               <picture>99999</picture><br />//            </bind><br /><br />//            <event activity="click"><br />//               <script contenttype="application/x-javascript"><br />               <br />//var date1 = new date(getfield("dob").value);



More discussions in LiveCycle pre-ES (6.x and 7.x) discussions


adobe

Comments